Merge pull request #1812 from davep/more-reactive-types

Add a couple of extra type hints to reactives
This commit is contained in:
Will McGugan
2023-02-21 11:10:22 +00:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -145,7 +145,7 @@ class Button(Static, can_focus=True):
ACTIVE_EFFECT_DURATION = 0.3
"""When buttons are clicked they get the `-active` class for this duration (in seconds)"""
label: reactive[RenderableType] = reactive("")
label: reactive[RenderableType] = reactive[RenderableType]("")
"""The text label that appears within the button."""
variant = reactive("default")

View File

@@ -72,7 +72,7 @@ class Placeholder(Widget):
_COLORS = cycle(_PLACEHOLDER_BACKGROUND_COLORS)
_SIZE_RENDER_TEMPLATE = "[b]{} x {}[/b]"
variant: Reactive[PlaceholderVariant] = reactive("default")
variant: Reactive[PlaceholderVariant] = reactive[PlaceholderVariant]("default")
_renderables: dict[PlaceholderVariant, str]