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

Prevent reactive-watcher loop in Tabs / TabbedContent. #2305

Merged
merged 5 commits into from
Apr 18, 2023

Conversation

rodrigogiraoserrao
Copy link
Contributor

This will close #2229.
See this comment wherein for an explanation of the issue.

We use a descriptor to proxy the attribute active from Tabs to TabbedContent without having to keep it in sync in two different places.

@rodrigogiraoserrao rodrigogiraoserrao changed the title Break reactive-watcher loop in Tabs / TabbedContent. Prevent reactive-watcher loop in Tabs / TabbedContent. Apr 17, 2023
Labels are cheaper to use and the final visual result of the test won't depend on the directory it runs from.
Turns out I didn't need a descriptor. :(
Comment on lines 123 to 124
if not active:
raise ValueError("'active' tab must not be empty string.")
Copy link
Contributor Author

@rodrigogiraoserrao rodrigogiraoserrao Apr 17, 2023

Choose a reason for hiding this comment

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

Originally I just let the setter set the attribute active on the child Tabs but the tests failed because they expected a ValueError when setting the tab to an empty string, so I added it back in 6eb141c.

However, to me it doesn't make much sense that I can't set TabbedContent.active = "" but I can set Tabs.active = "".
Am I "right"? If so, do we allow active = "" everywhere or nowhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@willmcgugan pinging you because you already merged but this was left unresolved.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think an active tab of empty string doesn't anything useful, so it probably should be an error in both places.

@willmcgugan willmcgugan merged commit 66a6448 into main Apr 18, 2023
@willmcgugan willmcgugan deleted the reactive-loop-in-tabs branch April 18, 2023 10:48
willmcgugan added a commit that referenced this pull request Apr 18, 2023
willmcgugan added a commit that referenced this pull request Apr 18, 2023
* Revert "Prevent reactive-watcher loop in Tabs / TabbedContent. (#2305)"

This reverts commit 66a6448.

* fix stuck tab

* fix for stuck underline

* snpshot
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.

It's possible to somehow break the working of TabbedContent
2 participants