-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix constrained tabbing failures with Safari and Firefox #47426
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
Merged
afercia
merged 11 commits into
trunk
from
fix/constrained-tabbing-safari-firefox-failures
Feb 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7c087b4
Make the modal content container focusable when scrollable.
afercia 80ea82d
Add test, improve existing a11y tests and run them with all browsers.
afercia 7a87f07
Fix useConstrainedTabbing edge cases.
afercia 66a4693
Add basic focus style for the scrollable section.
afercia 2ce7d2a
Update snapshots.
afercia 4fcb5b7
Clean up a11y test.
afercia 3900724
Refine test.
afercia abc31c2
Remove scrollableContentLabel prop.
afercia 04b9c37
Restore conditional aria-label for the scrollable section.
afercia 47a5430
Update test after change to closeButtonLabel default.
afercia 50da893
Add comment to clarify test.
afercia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Restore conditional aria-label for the scrollable section.
- Loading branch information
commit 04b9c374ca4f2d09b1ffac5fa534fdc00c7d7a4c
There are no files selected for viewing
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
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.
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.
Do you think we can extract all this logic into a hook
const { ref, props } = useScrollable();and just basically apply the "ref" and "props" to the element that is supposed to be scrollable? I think it might bring some clarity to the code 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.
Also, not sure why we need
childrenContainerRefcan't we just check the height of the scrollable itself (or at least its children) ?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.
The scrollable element has a fixed height,
The height of the content (the children) determines the actual content overflow, when it's greater than the scrollable height.
There may be multipole children though. Not sure how to calculate eh height of multiple children that could also be dynamically rendered. Seems to me the simplest option is to check for the height of an additional container.
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.
I'm all for better abstraction and improvements. I'd prefer to do that when enhancing the
Scrollablecomponent though. See #45809