1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

textarea: don't call LV_EVENT_INSERT too far before insertion

This commit is contained in:
embeddedt 2020-07-21 11:16:26 -04:00 committed by GitHub
parent 557342cc08
commit 806f3a9bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,7 +244,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
#endif
ta_insert_replace = NULL;
lv_event_send(ta, LV_EVENT_INSERT, letter_buf);
if(ta_insert_replace) {
if(ta_insert_replace[0] == '\0') return; /*Drop this text*/
@ -268,6 +268,8 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c)
return;
}
lv_event_send(ta, LV_EVENT_INSERT, letter_buf);
/*If a new line was added it shouldn't show edge flash effect*/
bool edge_flash_en = lv_textarea_get_edge_flash(ta);
lv_textarea_set_edge_flash(ta, false);
@ -334,7 +336,6 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt)
lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta);
ta_insert_replace = NULL;
lv_event_send(ta, LV_EVENT_INSERT, txt);
if(ta_insert_replace) {
if(ta_insert_replace[0] == '\0') return; /*Drop this text*/
@ -357,6 +358,7 @@ void lv_textarea_add_text(lv_obj_t * ta, const char * txt)
return;
}
lv_event_send(ta, LV_EVENT_INSERT, txt);
/*If a new line was added it shouldn't show edge flash effect*/
bool edge_flash_en = lv_textarea_get_edge_flash(ta);
lv_textarea_set_edge_flash(ta, false);