Skip to content

Commit

Permalink
Fix find_next_valid_focus() freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jun 30, 2022
1 parent 0800d47 commit 8d62b73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2422,7 +2422,7 @@ Control *Control::find_next_valid_focus() const {
}
}

if (next_child == from) { // No next control.
if (next_child == from || next_child == this) { // No next control.
return (get_focus_mode() == FOCUS_ALL) ? next_child : nullptr;
}
if (next_child) {
Expand Down Expand Up @@ -2506,7 +2506,7 @@ Control *Control::find_prev_valid_focus() const {
}
}

if (prev_child == from) { // No prev control.
if (prev_child == from || prev_child == this) { // No prev control.
return (get_focus_mode() == FOCUS_ALL) ? prev_child : nullptr;
}

Expand Down

0 comments on commit 8d62b73

Please sign in to comment.