dashboard: fix setup keyboard done button
This commit is contained in:
@@ -1229,7 +1229,7 @@ static void setup_keyboard_event_cb(lv_event_t *event)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(event);
|
||||
|
||||
if (code == LV_EVENT_READY || code == LV_EVENT_CANCEL) {
|
||||
if (code == LV_EVENT_READY || code == LV_EVENT_CANCEL || code == LV_EVENT_CLICKED) {
|
||||
if (setup_keyboard != nullptr) {
|
||||
lv_keyboard_set_textarea(setup_keyboard, nullptr);
|
||||
lv_obj_add_flag(setup_keyboard, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DASHBOARD = ROOT / "firmware" / "esp32-s3-dashboard" / "esp32-s3-dashboard.ino"
|
||||
|
||||
|
||||
def test_setup_done_button_event_is_handled():
|
||||
source = DASHBOARD.read_text()
|
||||
|
||||
callback_start = source.index("static void setup_keyboard_event_cb")
|
||||
callback_end = source.index("static void setup_textarea_event_cb", callback_start)
|
||||
callback = source[callback_start:callback_end]
|
||||
|
||||
assert "LV_EVENT_CLICKED" in callback
|
||||
assert "lv_obj_add_flag(setup_keyboard, LV_OBJ_FLAG_HIDDEN);" in callback
|
||||
assert "lv_obj_add_event_cb(done_button, setup_keyboard_event_cb, LV_EVENT_CLICKED" in source
|
||||
Reference in New Issue
Block a user