-
Notifications
You must be signed in to change notification settings - Fork 13
fix: set DBTabItem selected state correctly #5399
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d3c5b8d The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
| props.onChange(event); | ||
| } | ||
|
|
||
| // We have different ts types in different frameworks, so we need to use any here |
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.
Maybe we can keep this - the aria snapshots changed so it might be good to keep those additonally
Set (aria-)selected state via listener on parent tablist to also react on de-selection of item.
use var instead of file to hold click event results for test duration
Now also sets aria-selected=true|false correctly which improves screen reader behaviour.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
set child active after event registered, remove event listerner on unmount
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
add more checks and guardrails to TabItem on change events
ee7cfbe to
d1535e1
Compare
Set (aria-)selected state via listener on parent tablist to also react on de-selection of item. Closes #5288
Proposed changes
Each tab item holds an internal state
_selectedto keep track of the active tab. However before this change the state function did not correctly react to a de-selection because the event was only triggered on the newly active tab.Now each item registers an event listener on the parent component and sets de/selected according to this event.
The playwright test for the tab components has also been refactored slightly to eliminate an unneccesary file write process.
Types of changes
Bugfix (non-breaking change that fixes an issue)
New feature (non-breaking change which adds functionality)
Refactoring (improvements to existing components or architectural decisions)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Documentation Update (if none of the other choices apply)
I have added tests that prove my fix is effective or that my feature works
I have added necessary documentation (if appropriate)
🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/fix-tab-item-selected-state