mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Only block mouse events if disabled, not if not focusable
This commit is contained in:
@@ -2449,9 +2449,13 @@ class Widget(DOMNode):
|
||||
# Do the normal checking and get out if that fails.
|
||||
if not super().check_message_enabled(message):
|
||||
return False
|
||||
# Otherwise, if this is a mouse event the widget receiving the event
|
||||
# must be capable of being focused right at this moment.
|
||||
return self.focusable if isinstance(message, events.MouseEvent) else True
|
||||
# Otherwise, if this is a mouse event, the widget receiving the
|
||||
# event must not be disabled at this moment.
|
||||
return (
|
||||
not self._self_or_ancestors_disabled
|
||||
if isinstance(message, events.MouseEvent)
|
||||
else True
|
||||
)
|
||||
|
||||
async def broker_event(self, event_name: str, event: events.Event) -> bool:
|
||||
return await self.app._broker_event(event_name, event, default_namespace=self)
|
||||
|
||||
Reference in New Issue
Block a user