Skip to content
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

Allow enabling/disabling tab via tab pane. #3152

Merged
merged 6 commits into from
Aug 23, 2023
Merged

Conversation

rodrigogiraoserrao
Copy link
Contributor

This fixes #3149.

This allows one to use the 'disabled' attribute in tab panes to enable/disable a tab, which is particularly useful if you want to instantiate a tab that starts off as disabled, as seen in #3149.
@rodrigogiraoserrao rodrigogiraoserrao self-assigned this Aug 23, 2023
@rodrigogiraoserrao rodrigogiraoserrao marked this pull request as ready for review August 23, 2023 11:13
@rodrigogiraoserrao rodrigogiraoserrao added the enhancement New feature or request label Aug 23, 2023
return self.tab_pane

@dataclass
class Enabled(Message):
Copy link
Contributor

@davep davep Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might it not make sense to give this and TabPane.Disabled a common parent class (adds to the utility of @on for example)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not fussed either way. I'll add it if you ask for it, otherwise I'll just merge this PR. 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like it would be more in keeping with where we're slowly heading with multiple messages on a widget (where appropriate); but it sure wasn't a "must do won't approve or else". ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point taken. 9ef644c.

@rodrigogiraoserrao rodrigogiraoserrao merged commit 7563a39 into main Aug 23, 2023
20 checks passed
@rodrigogiraoserrao rodrigogiraoserrao deleted the disable-tab-pane branch August 23, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The disabled parameter for a TabPane should disable a tab
2 participants