Skip to content

Commit

Permalink
don't assume widget
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Apr 19, 2024
1 parent 149e57e commit c1e25dd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/textual/css/_style_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,13 +956,16 @@ def __set__(self, obj: StylesBase, color: Color | str | None) -> None:
if obj.node is None:
return

widget = cast("Widget", obj.node)
from ..widget import Widget

if widget.show_horizontal_scrollbar:
widget.horizontal_scrollbar.refresh()
if isinstance(obj.node, Widget):
widget = obj.node

if widget.show_horizontal_scrollbar:
widget.horizontal_scrollbar.refresh()

if widget.show_vertical_scrollbar:
widget.vertical_scrollbar.refresh()
if widget.show_vertical_scrollbar:
widget.vertical_scrollbar.refresh()


class StyleFlagsProperty:
Expand Down

0 comments on commit c1e25dd

Please sign in to comment.