Skip to content

Commit 4c5d5ac

Browse files
authored
Fix styles not updating when a widget is blurred (#4771)
* Fix styles not updating when a widget is blurred * Update changelog
1 parent c9bb137 commit 4c5d5ac

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3232
- Fixed message handlers not working when message types are assigned as the value of class vars https://github.com/Textualize/textual/pull/3940
3333
- Fixed `CommandPalette` not focusing the input when opened when `App.AUTO_FOCUS` doesn't match the input https://github.com/Textualize/textual/pull/4763
3434
- `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
35+
- Fixed focus styles not being updated on blur https://github.com/Textualize/textual/pull/4771
3536

3637
### Changed
3738

src/textual/screen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ def set_focus(self, widget: Widget | None, scroll_visible: bool = True) -> None:
705705
# No focus, so blur currently focused widget if it exists
706706
if self.focused is not None:
707707
self.focused.post_message(events.Blur())
708-
self.focused = None
709708
blurred = self.focused
709+
self.focused = None
710710
self.log.debug("focus was removed")
711711
elif widget.focusable:
712712
if self.focused != widget:

0 commit comments

Comments
 (0)