Skip to content

Commit

Permalink
fix update styles (#3860)
Browse files Browse the repository at this point in the history
* fix update styles

* snapshot test, version bump

* changelog

* snapshot
  • Loading branch information
willmcgugan authored Dec 12, 2023
1 parent ea3020f commit 4bfb82a
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.45.1] - 2023-12-12

### Fixed

- Fixed issues were styles wouldn't update if changed in mount. https://github.com/Textualize/textual/pull/3860

## [0.45.0] - 2023-12-12

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "0.45.0"
version = "0.45.1"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
9 changes: 4 additions & 5 deletions src/textual/dom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,10 @@ def _update_styles(self) -> None:
Should be called whenever CSS classes / pseudo classes change.
"""
if self._is_mounted:
try:
self.app.update_styles(self)
except NoActiveAppError:
pass
try:
self.app.update_styles(self)
except NoActiveAppError:
pass

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

0 comments on commit 4bfb82a

Please sign in to comment.