mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Don't allow a radio button to be turned off
This commit is contained in:
@@ -99,6 +99,10 @@ class RadioSet(Container):
|
||||
if button.value and button != event.input:
|
||||
button.value = False
|
||||
break
|
||||
else:
|
||||
# If this leaves us with no buttons checked, disallow that.
|
||||
if not any(button.value for button in self._buttons):
|
||||
event.input.value = True
|
||||
|
||||
@property
|
||||
def pressed_index(self) -> int:
|
||||
|
||||
Reference in New Issue
Block a user