Defocus the textarea when clicking outside?


The textarea having keyboard attached on it. When clicking outside the textarea, the keyboard should disappear.

That can happen correctly in the current live demo version in website (not sure version), clicking into the panel, the textarea losts focus & the keyboard becomes hidden. As shown in screenshot below.



However in my version v8.3 & simulator in Visual Studio, clicking outside the textarea, into the panel, the textarea cannot lost focus and the keyboard still in place:


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

Simulator in Visual Studio

What LVGL version are you using?


What do you want to achieve?

Click into a panel outside the textarea can defocus the textarea, so the keyboard can be hidden.

What have you tried so far?

Tried the online web version of the demo can do the stuff.

Code to reproduce

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

For now by injecting the event callback, I see the panel got LV_EVENT_FOCUSED event when clicked already, however even the panel got focused, the textarea still having focus and the keyboard remains intact.

lv_obj_add_event_cb(ui_Panel_Login, _ui_keyboard_event_callback, LV_EVENT_ALL, m_ui_keyboard);     // handle focus

For working around, hide the keyboard manually by code:

lv_obj_add_flag(m_ui_keyboard, LV_OBJ_FLAG_HIDDEN);

This is in v8.3.

Please can anyone suggest how to remove the textarea focus automatically when clicking into all the panels, without any manual callback code for each object?