mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Don't force a radio set to have at least one button on on start
It felt like the right thing to do, but it shouldn't be necessary. There are times where someone may actually want to have a radio set with no buttons pushed to start with.
This commit is contained in:
@@ -48,13 +48,6 @@ class RadioSet(Container):
|
||||
"""The buttons within the set."""
|
||||
return self.query(RadioButton)
|
||||
|
||||
def on_mount(self) -> None:
|
||||
"""Set up the radio group for use after the DOM is loaded."""
|
||||
buttons = self._buttons
|
||||
on_buttons = buttons.filter(".-on")
|
||||
if buttons and not on_buttons:
|
||||
buttons[0].value = True
|
||||
|
||||
class Changed(Message, bubble=True):
|
||||
"""Posted when the pressed button in the set changes."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user