diff --git a/src/widgets/lv_textarea.c b/src/widgets/lv_textarea.c index 6b5ec4e46..8624b01d0 100644 --- a/src/widgets/lv_textarea.c +++ b/src/widgets/lv_textarea.c @@ -963,19 +963,13 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c) { lv_textarea_t * ta = (lv_textarea_t *)obj; - /*If the accepted char list in not specified the accept the character*/ - if(ta->accepted_chars == NULL) return true; - - /*If no restriction accept it*/ - if((ta->accepted_chars == NULL || ta->accepted_chars[0] == '\0') && ta->max_length == 0) return true; - /*Too many characters?*/ if(ta->max_length > 0 && _lv_txt_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) { return false; } + if(ta->accepted_chars == NULL || ta->accepted_chars[0] == '\0') return true; /*Accepted character?*/ - /*We're sure ta->accepted_chars != NULL*/ uint32_t i = 0; while(ta->accepted_chars[i] != '\0') {