From 833e39eb7d650c249bf0e3810bea4a0e55e52a57 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 17 Jul 2024 22:51:34 +0100 Subject: [PATCH 1/2] Fix styles not updating when a widget is blurred --- src/textual/screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/screen.py b/src/textual/screen.py index cf233fbc8a..28168173ef 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -705,8 +705,8 @@ def set_focus(self, widget: Widget | None, scroll_visible: bool = True) -> None: # No focus, so blur currently focused widget if it exists if self.focused is not None: self.focused.post_message(events.Blur()) - self.focused = None blurred = self.focused + self.focused = None self.log.debug("focus was removed") elif widget.focusable: if self.focused != widget: From e9772ae7b991c1d947f5ce3c7a0838ad1b32fe46 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Wed, 17 Jul 2024 22:55:54 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3518374a5e..0efe58b4df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed message handlers not working when message types are assigned as the value of class vars https://github.com/Textualize/textual/pull/3940 - Fixed `CommandPalette` not focusing the input when opened when `App.AUTO_FOCUS` doesn't match the input https://github.com/Textualize/textual/pull/4763 - `SelectionList.SelectionToggled` will now be sent for each option when a bulk toggle is performed (e.g. `toggle_all`). Previously no messages were sent at all. https://github.com/Textualize/textual/pull/4759 +- Fixed focus styles not being updated on blur https://github.com/Textualize/textual/pull/4771 ### Changed