-
Notifications
You must be signed in to change notification settings - Fork 602
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
SubNav: Update selected styles to only apply to data-selected='true'
#5797
Conversation
🦋 Changeset detectedLatest commit: 0ac27cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
data-selected='true'
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.
Thank you!
When the SunNav component is used in an environment with practical data, it is high likely that the
selected
attribute will be used in each SubNav children and their value will be conditionally rendered to true or false. Therefore the generated HTML will beCurrently the way we apply the selected styles are causing bug because the styles are applied to all links because all have
data-selected
property.Here is an example from RL that shows the bug
There is currently no usage of SubNav at dotcom - this is why we probably didn't noticed the issue so far.
Changelog
New
Changed
data-selected
attribute to apply selected styles, I updated the code to selectdata-selected="true"
Removed
Rollout strategy
Testing & Reviewing
If you could edit the Selected story so that each children have selected prop. You can repro the issue and with the change in this PR, you can verify the fix.
Merge checklist