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

Enable unsetting active tab pane / tab #4298

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

rodrigogiraoserrao
Copy link
Contributor

Goes over TabbedContent and Tabs and allows unsetting their respective tab pane/tab.
Although we currently don't know if it makes a lot of sense (Will did mention a custom widget/renderable/thingy situation where it could make sense to have no active tab) we won't prevent the programmers to make use of this flexibility in their apps.

Went through both widgets to make sure the Cleared messages are sent in the correct places and not in duplicate.

Also made a small change so that if there's no active tab, then pressing right/left will respectively activate the first or last tab.

Fixed the documentation as reported in #4241.

Fixes #4241.

Although we can't quite see what would be a use case for a tabbed content where there are tabs and none of them are active (for example, it's weird to think of a browser where we have a bunch of tabs open and none of them are active...), we decided we'd let that possibility exist in code: the reactive `.active` can be set to the empty string both on `Tabs` and on `TabbedContent`.
Now that the watcher for `TabbedContent.active` accepts empty strings and emits the message `TabbedContent.Cleared` if `active` is the empty string, we don't need to explicit emit the messages in these two locations.
@rodrigogiraoserrao rodrigogiraoserrao marked this pull request as ready for review March 14, 2024 15:17
Copy link
Contributor

@davep davep left a comment

Choose a reason for hiding this comment

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

I have full confidence that this will be the last change to TabbedContent ever.

@willmcgugan willmcgugan merged commit f9427e4 into main Mar 18, 2024
20 checks passed
@willmcgugan willmcgugan deleted the tabbed-content-issue-dave-didnt-fix branch March 18, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs.Cleared documentation a little ambiguous
3 participants