From 2d9d5fafd1ccf54fec0ab0c030d3429f221ffaed Mon Sep 17 00:00:00 2001 From: Liu Date: Mon, 21 Aug 2023 22:53:14 +0800 Subject: [PATCH] fix(ui): use the root widget as the default event target --- lib/ui/src/ui_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/src/ui_events.c b/lib/ui/src/ui_events.c index 1d99175d..a2c9a9b4 100644 --- a/lib/ui/src/ui_events.c +++ b/lib/ui/src/ui_events.c @@ -918,7 +918,7 @@ static int ui_on_keyboard_event(ui_event_t *origin_event) e.target = ui_events.targets[UI_WIDGET_STATUS_FOCUS]; if (!e.target) { - return -1; + e.target = ui_root(); } e.cancel_bubble = false; ui_widget_emit_event(e.target, e, NULL);