-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabling a selected tab in TabbedContent
leaves it selected
#3148
Comments
Disabled tabs can be selected if they're disabled after being selected, and that's by design. Inside When a tab is disabled do we want to move automatically to the next one, then? |
I sense it's something we should consider. IIRC don't we move focus of a widget when it is disabled? If so I feel we should attempt similar when it comes to tabs. |
Yes
You may be right. |
I think we get to decide. :-) |
I'm all up for being consistent with how focus works in other situations. |
I've not seen/tested hiding, but if it works as I'd expect then, yeah, I think that's likely what people would expect to happen (assuming disabled really is "can't be selected at all, no way, not at all"). |
You haven't seen hiding? That's because it's working correctly! 😆
That's it. |
|
I think I'll go back on this. There's precedent in other frameworks for a disabled tab that isn't automatically unselected, much like disabling a button wouldn't suddenly interrupt whatever actions were being carried out because the button was clicked previously. @davep do you think this is sensible at all or do you firmly believe we should deactivate a disabled tab? |
I've got no firm view either way really (I was just refreshing my memory on how VCL did/does it and it's anything goes really, if I'm reading it correctly). Personally I'd favour least astonishment within the context of how disabled works more generally in Textual. |
I'm closing this as “wontfix” with the caveat that this was a close call and therefore the decision might be reversed in the future. Arguments in favour of not deactivating the currently-active tab if it is disabled, in no particular order:
|
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
With #3145 in mind and this applied:
consider this code:
On startup the disabled tab will still be selected. Perhaps when a tab is disabled the next eligible tab should be selected (much like I believe it does if you remove a tab?).
The text was updated successfully, but these errors were encountered: