From d505429dd8345bc23b971dcde07d00887b24e59d Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 17 May 2021 20:22:01 +0200 Subject: [PATCH] fix(keyboard) do not deassign the textarea on OK or CANCEL click --- examples/widgets/textarea/lv_example_textarea_2.c | 5 +---- src/extra/widgets/keyboard/lv_keyboard.c | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/widgets/textarea/lv_example_textarea_2.c b/examples/widgets/textarea/lv_example_textarea_2.c index dc07b1129..0a915caa9 100644 --- a/examples/widgets/textarea/lv_example_textarea_2.c +++ b/examples/widgets/textarea/lv_example_textarea_2.c @@ -52,10 +52,7 @@ static void ta_event_cb(lv_event_t * e) } else if(code == LV_EVENT_READY) { - const char * str = lv_event_get_param(e); - if(str[0] == '\n') { - LV_LOG_USER("Ready\n"); - } + LV_LOG_USER("Ready, current text: %s", lv_textarea_get_text(ta)); } } diff --git a/src/extra/widgets/keyboard/lv_keyboard.c b/src/extra/widgets/keyboard/lv_keyboard.c index de845defe..eff7978dd 100644 --- a/src/extra/widgets/keyboard/lv_keyboard.c +++ b/src/extra/widgets/keyboard/lv_keyboard.c @@ -260,7 +260,6 @@ void lv_keyboard_def_event_cb(lv_event_t * e) res = lv_event_send(keyboard->ta, LV_EVENT_CANCEL, NULL); if(res != LV_RES_OK) return; } - lv_keyboard_set_textarea(obj, NULL); /*De-assign the text area to hide it cursor if needed*/ return; } else if(strcmp(txt, LV_SYMBOL_OK) == 0) { @@ -271,8 +270,6 @@ void lv_keyboard_def_event_cb(lv_event_t * e) res = lv_event_send(keyboard->ta, LV_EVENT_READY, NULL); if(res != LV_RES_OK) return; } - - lv_keyboard_set_textarea(obj, NULL); /*De-assign the text area to hide it cursor if needed*/ return; }