You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
When updating an aria label in a slotted component, the mutation observer would run and update the tabs aria labels. As this is behind the scene, no one ever noticed it.
When updating any slotted component that have a disabled or active 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 of SlTabGroup, 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.
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 aria-labelledby or aria-controls provided. I have adjusted the attribute list, but still I think it would be better to scope the mutation observer on the direct children and proceed from there for easier logic.
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%.
@schilchSICKAG Sorry, ive been sick most of this week and Cory has been out as well, let me take a look.
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 :)
@schilchSICKAG Sorry, ive been sick most of this week and Cory has been out as well, let me take a look.
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 :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fixed-in-waThis issue has been fixed or isn't relevant to Web Awesome.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
disabledoractiveprop, it will also fire the mutation observers logic.The error became more apparent when we tried to fix the
activeproperty, 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
subtreecheck 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.