Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/textual/css/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,10 @@ def _update_rules(
changes = updates + removed
if not changes:
return False
geometry = any(
# Detached styles normalize rules (including mount's prepared copy)
# but have no node geometry to invalidate. Keep validation and rule
# publication intact; acquire placement effects only for their owner.
geometry = self.node is not None and any(
descriptor.affects_geometry(previous, value)
for descriptor, key, previous, value in changes
)
Expand Down
3 changes: 2 additions & 1 deletion tests/css/test_stylesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ async def test_style_batch_keeps_child_damage_separate_and_flushes_interrupted_e
parent.styles.refresh(layout=True)
with parent.styles.batch_update():
parent.styles.color = "green"
refresh.assert_called_once_with(layout=False, repaint=True)
refresh.assert_called_once_with(repaint=True)
assert not child._layout_required
assert child.rich_style.color == Color.parse("green").rich_color
with pytest.raises(StyleValueError), parent.styles.batch_update():
parent.styles.color = "red"
Expand Down
Loading