fix(list): in lv_list remove clean last_sel_btn and act_sel_btn only if arelated button was deleted

related to #1895
This commit is contained in:
Gabor Kiss-Vamosi
2020-11-13 23:15:24 +01:00
parent 54883792e1
commit 6060d4d1f6
+5 -5
View File
@@ -254,12 +254,12 @@ bool lv_list_remove(const lv_obj_t * list, uint16_t index)
uint16_t count = 0;
lv_obj_t * e = lv_list_get_next_btn(list, NULL);
while(e != NULL) {
#if LV_USE_GROUP
if(e == ext->last_sel_btn) ext->last_sel_btn = NULL;
#endif
if(e == ext->act_sel_btn) ext->act_sel_btn = NULL;
if(count == index) {
#if LV_USE_GROUP
if(e == ext->last_sel_btn) ext->last_sel_btn = NULL;
#endif
if(e == ext->act_sel_btn) ext->act_sel_btn = NULL;
lv_obj_del(e);
return true;
}