-
Notifications
You must be signed in to change notification settings - Fork 82
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: keyboard navigation when using position fixed #5792
fix: keyboard navigation when using position fixed #5792
Conversation
Kudos, SonarCloud Quality Gate passed!
|
|
||
it('should return false when using fixed positioning', () => { | ||
element.style.position = 'fixed'; | ||
expect(isElementHidden(element)).to.be.false; |
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.
Also wanted to check the child's visibility here, but in case of these nested divs, the child's offset parent is actually the parent div. In case of tabs being used within the app layouts drawer there must be some additional detail that causes the offset parent to become null.
Description
Keyboard navigation for tab bar is currently broken when the element is within the app layout's drawer. The cause is the following check which incorrectly identifies all tabs as hidden:
web-components/packages/a11y-base/src/focus-utils.js
Lines 148 to 153 in 7a9fbf1
The problem is that
offsetParent
is also null if the element is using fixed positioning. It can also be null for nested elements in a container with fixed positioning, such as for the tabs being in the app layouts drawer.This change adds an additional check to verify that items have no client size which would be another indicator that
display: none
is being used in the hierarchy.Fixes #5706
Type of change