Merge pull request #961 from davep/bug/939/loss-of-focus-tidy-up

Post-PR #954 tidy up
This commit is contained in:
Will McGugan
2022-10-19 16:15:03 +01:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -1454,8 +1454,8 @@ class App(Generic[ReturnType], DOMNode):
widget = event.widget
parent = widget.parent
remove_widgets = list(
widget.walk_children(Widget, with_self=True, method="depth", reverse=True)
remove_widgets = widget.walk_children(
Widget, with_self=True, method="depth", reverse=True
)
if self.screen.focused in remove_widgets:

View File

@@ -263,7 +263,7 @@ class Screen(Widget):
for candidate in reversed(
focusable_widgets[widget_index + 1 :] + focusable_widgets[:widget_index]
):
if candidate not in avoiding and candidate.can_focus:
if candidate not in avoiding:
chosen = candidate
break