-
-
Notifications
You must be signed in to change notification settings - Fork 993
Closed
Description
As of Textual 6.0.0, widgets inside a collapsible container can no longer be tabbed through, when going from a state of collapsed to expanded.
Additional behaviours noticed:
- Mounting an already expanded Collapsible widget, will show the original behaviour (i.e. children inside can be focused with tab);
- Handling the Expanded event to give focus to a widget inside, will correctly pass focus to the widget, but tabbing again will give focus to the first widget in the compose method, instead of going to the next one;
- Clicking a widget, inside the container, with the mouse and pressing tab will go through the same behaviour of the previous point.
MRE:
The MRE will show the button, inside the first expanded collapsible, as focusable while tabbing. Meanwhile, the input fields inside the second one will be skipped, when the container is opened.
Closing and reopening either Collapsible widget will leave the children inside unfocusable by tabbing.
from textual.app import App
from textual.widgets import Input, Collapsible, Button
class Collapsible_test(App):
def compose(self):
yield Input()
with Collapsible(collapsed=False):
yield Button()
with Collapsible():
yield Input()
yield Input()
yield Input()
if __name__ == "__main__":
app = Collapsible_test()
app.run()
TomJGooding
Metadata
Metadata
Assignees
Labels
No labels