mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Fix ddlist controlled via keyboard
The selected option is tracked correctly when scrolling through the dropdown list via keyboard
This commit is contained in:
parent
aad9f76a39
commit
cab6ce93d6
@ -515,7 +515,7 @@ static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * par
|
||||
if(c == LV_GROUP_KEY_RIGHT || c == LV_GROUP_KEY_DOWN) {
|
||||
if(ext->sel_opt_id + 1 < ext->option_cnt) {
|
||||
ext->sel_opt_id ++;
|
||||
lv_obj_invalidate(ddlist);
|
||||
lv_ddlist_pos_current_option(ddlist);
|
||||
if(ext->action != NULL) {
|
||||
ext->action(ddlist);
|
||||
}
|
||||
@ -523,7 +523,7 @@ static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * par
|
||||
} else if(c == LV_GROUP_KEY_LEFT || c == LV_GROUP_KEY_UP) {
|
||||
if(ext->sel_opt_id > 0) {
|
||||
ext->sel_opt_id --;
|
||||
lv_obj_invalidate(ddlist);
|
||||
lv_ddlist_pos_current_option(ddlist);
|
||||
if(ext->action != NULL) {
|
||||
ext->action(ddlist);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user