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

fix(gridnav): send focus/defocus event from gridnav key handler (#6385)

This commit is contained in:
di-jtrumpower 2024-07-03 21:03:31 -05:00 committed by GitHub
parent cd7eccc25e
commit aea90766a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -229,7 +229,9 @@ static void gridnav_event_cb(lv_event_t * e)
if(guess && guess != dsc->focused_obj) {
lv_obj_remove_state(dsc->focused_obj, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY);
lv_obj_send_event(dsc->focused_obj, LV_EVENT_DEFOCUSED, lv_indev_active());
lv_obj_add_state(guess, LV_STATE_FOCUSED | LV_STATE_FOCUS_KEY);
lv_obj_send_event(guess, LV_EVENT_FOCUSED, lv_indev_active());
lv_obj_scroll_to_view(guess, LV_ANIM_ON);
dsc->focused_obj = guess;
}