Skip to content

Commit 4bfb82a

Browse files
authored
fix update styles (#3860)
* fix update styles * snapshot test, version bump * changelog * snapshot
1 parent ea3020f commit 4bfb82a

File tree

6 files changed

+207
-6
lines changed

6 files changed

+207
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
9+
## [0.45.1] - 2023-12-12
10+
11+
### Fixed
12+
13+
- Fixed issues were styles wouldn't update if changed in mount. https://github.com/Textualize/textual/pull/3860
14+
815
## [0.45.0] - 2023-12-12
916

1017
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.45.0"
3+
version = "0.45.1"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/dom.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,11 +1209,10 @@ def _update_styles(self) -> None:
12091209
12101210
Should be called whenever CSS classes / pseudo classes change.
12111211
"""
1212-
if self._is_mounted:
1213-
try:
1214-
self.app.update_styles(self)
1215-
except NoActiveAppError:
1216-
pass
1212+
try:
1213+
self.app.update_styles(self)
1214+
except NoActiveAppError:
1215+
pass
12171216

12181217
def add_class(self, *class_names: str, update: bool = True) -> Self:
12191218
"""Add class names to this Node.

0 commit comments

Comments
 (0)