-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Fix: Nested tab groups broken in v2.19.1 #2367
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Just had another look onto the functionality and noticed that I have read the code wrong. The aria labels should be updated when there is no |
@KonnorRogers: |
@schilchSICKAG Sorry, ive been sick most of this week and Cory has been out as well, let me take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid to me. Appreciate you taking the time to get this fixed.
EDIT: as for subtree, im missing some context as well, but im assuming we used it so we dont need to track changes with slotchange
events? I'm not 100%.
Thanks for taking time for the review :). No need to apologize, I thought you would be knee deep into web-awesome and there is probably be not that much time left for Shoelace currently, so I just wanted to ping :) |
Well yea, that too 🙈 |
This PR fixes #2320 by getting rid of the problems introduced by the Synergy Team with the fix #2299.
The problem was that the mutation observer was never scoped in the first place, using subtree checks to adjust itself even when children updated properties that both tabs and the children share.
This original Problem went unnoticed: The mutation observer originally checked its subtree completely, too.
This leads to the following errors:
disabled
oractive
prop, it will also fire the mutation observers logic.The error became more apparent when we tried to fix the
active
property, because naturally, it is shared in both instances ofSlTabGroup
, making the navigation change of the children group cause a mutation update on the parent :(.With this PR, I tried to:
a) Make sure to hold the original logic for the mutation observer
b) Scope the changes to the first level of mutations by not directly querying the original mutations anymore.
c) Restrict the amount of events for children attribute changes by filtering those we are interested in to make it a little more performant.
On a sidenode, I have not fully understood why we are using a
subtree
check at here at all, but there may be reasons it can be beneficial (e.g. when you have some DOM nodes wrapping the tabs or tab-groups), so I did opt to not change this, too.