Skip to content

Commit

Permalink
fix(dropdown) forget the selected option on encoder longpress
Browse files Browse the repository at this point in the history
  • Loading branch information
kisvegabor committed Jun 23, 2021
1 parent 2df1282 commit e66b935
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/widgets/lv_dropdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,14 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e)
/*Encoders need special handling*/
if(indev_type == LV_INDEV_TYPE_ENCODER) {
/*Open the list if editing*/
if(editing) lv_dropdown_open(obj);
if(editing) {
lv_dropdown_open(obj);
}
/*Close the list if navigating*/
else
else {
dropdown->sel_opt_id = dropdown->sel_opt_id_orig;
lv_dropdown_close(obj);
}
}
}
else if(code == LV_EVENT_DEFOCUSED || code == LV_EVENT_LEAVE) {
Expand Down

0 comments on commit e66b935

Please sign in to comment.