Skip to content


fix(group) skip object if an of the parents is hidden
Browse files Browse the repository at this point in the history
Previously only the object itself was checked for hidden.
  • Loading branch information
kisvegabor committed Oct 13, 2021
1 parent ee5369e commit 5799c10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/lv_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,16 @@ static void focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *)
if(obj_next == NULL) continue;
if(lv_obj_get_state(*obj_next) & LV_STATE_DISABLED) continue;

/*Hidden objects don't receive focus*/
if(lv_obj_has_flag(*obj_next, LV_OBJ_FLAG_HIDDEN) == false) break;
/*Hidden objects don't receive focus.
*If any parent is hidden, the object is also hidden)*/
lv_obj_t * parent = *obj_next;
while(parent) {
if(lv_obj_has_flag(parent, LV_OBJ_FLAG_HIDDEN)) continue;
parent = lv_obj_get_parent(parent);

/*If we got her a good candidate is found*/

if(obj_next == group->obj_focus) return; /*There's only one visible object and it's already focused*/
Expand Down

0 comments on commit 5799c10

Please sign in to comment.