mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #1195 from davep/button-variant-check
Check button variant for validity during button construction
This commit is contained in:
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
- Watchers are now called immediately when setting the attribute if they are synchronous. https://github.com/Textualize/textual/pull/1145
|
- Watchers are now called immediately when setting the attribute if they are synchronous. https://github.com/Textualize/textual/pull/1145
|
||||||
- Widget.call_later has been renamed to Widget.call_after_refresh.
|
- Widget.call_later has been renamed to Widget.call_after_refresh.
|
||||||
|
- Button variant values are now checked at runtime. https://github.com/Textualize/textual/issues/1189
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ class Button(Static, can_focus=True):
|
|||||||
if disabled:
|
if disabled:
|
||||||
self.add_class("-disabled")
|
self.add_class("-disabled")
|
||||||
|
|
||||||
self.variant = variant
|
self.variant = self.validate_variant(variant)
|
||||||
|
|
||||||
label: Reactive[RenderableType] = Reactive("")
|
label: Reactive[RenderableType] = Reactive("")
|
||||||
variant = Reactive.init("default")
|
variant = Reactive.init("default")
|
||||||
|
|||||||
Reference in New Issue
Block a user