sneaky commit, bet Darren doesn't notice.

This commit is contained in:
Will McGugan
2024-11-20 14:28:34 +00:00
parent e6ade76c6b
commit f1a6036919

View File

@@ -562,6 +562,10 @@ class Screen(Generic[ScreenResultType], Widget):
except NoWidget: except NoWidget:
return None return None
if widget.has_class("-textual-system"):
# Clicking Textual system widgets should not focus anything
return None
for node in widget.ancestors_with_self: for node in widget.ancestors_with_self:
if isinstance(node, Widget) and node.focusable: if isinstance(node, Widget) and node.focusable:
return node return node