Text Area maximum length

Description

Text area maximum length not working.

What MCU/Processor/Board and compiler are you using?

ESP32 compiling with Arduino Vmicro in Visual Studio 2017

What do you experience?

I’m trying to set the maximum length of the ta to 2 characters but it looks like it only restrict to a minimum of 10.

What do you expect?

I expect it to reduce to less than 10

Code to reproduce

lv_obj_t *ta = lv_ta_create(parent, NULL);
lv_ta_set_max_length(ta, 2);
lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_LEFT, 100, 30);

If you set the text using lv_ta_set_text it ignores the maximum length (as mentioned in the documentation). How are you changing the text?

1 Like

I am using:
lv_obj_t *ta = lv_ta_create(parent, NULL);
lv_ta_set_max_length(ta, 2);
lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_LEFT, 100, 30);
lv_ta_set_text(ta,“12”);

I have looked throught the documentation and I can find no reference in the text area section that lv_ta_set_text ignores the maximum length.

The link I gave mentions it:

num: the maximal number of characters can be added ( lv_ta_set_text ignores it)