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

fix(dropdown): position to the selected item in lv_dropdown_set_selected

This commit is contained in:
Gabor Kiss-Vamosi 2023-08-25 13:25:22 +02:00
parent bcebafe4fb
commit f174589240

View File

@ -285,6 +285,10 @@ void lv_dropdown_set_selected(lv_obj_t * obj, uint16_t sel_opt)
dropdown->sel_opt_id = sel_opt < dropdown->option_cnt ? sel_opt : dropdown->option_cnt - 1;
dropdown->sel_opt_id_orig = dropdown->sel_opt_id;
if(dropdown->list) {
position_to_selected(obj);
}
lv_obj_invalidate(obj);
}