-
Notifications
You must be signed in to change notification settings - Fork 152
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
Modal accessibility #4615
Open
DSil
wants to merge
13
commits into
aria-label-bcs
Choose a base branch
from
dsil/modal-accessibility
base: aria-label-bcs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Modal accessibility #4615
+415
−210
Conversation
This file contains 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
Storybook staging is available at https://kiwicom-orbit-dsil-modal-accessibility.surge.sh Playroom staging is available at https://kiwicom-orbit-dsil-modal-accessibility.surge.sh/playroom |
Size Change: +144 B (+0.03%) Total Size: 461 kB
ℹ️ View Unchanged
|
Deploying orbit with
|
Latest commit: |
7bd50c5
|
Status: | ✅ Deploy successful! |
Preview URL: | https://db7b4683.orbit.pages.dev |
Branch Preview URL: | https://dsil-modal-accessibility.orbit.pages.dev |
7128f61
to
b2d6d62
Compare
These props can be used to enhance accessibility
This accepts a ref to the element that triggers the modal. This allows to restore the focus on the trigger element after closing the modal
The autoFocus prop now has no effect
BREAKING CHANGE: The modal now focuses the first focusable element by default. Therefore, the autoFocus prop is no longer needed
These are NOT related to this task, but are outdated from other tasks
b2d6d62
to
30f5ff7
Compare
BREAKING CHANGE: the labelClose prop no longer has a default value. It is now required whenever onClose is defined and hasCloseButton is not explicitly set to false (default value is true).
The codemod now also targets the Modal and the labelClose prop. Renamed the codemod because it is no longer exclusive to HorizontalScroll.
d69dd88
to
7bd50c5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A couple improvements to the Modal accessibility:
ariaLabel
,ariaLabelledby
andariaDescribedby
triggerRef
prop that receives a ref of the trigger element, allowing the focus to get back to it when the modal closesSome darwin visual tests were updated because they were outdated.
Also, visual tests were updated because they should now reflect the first focusable element with the focus.
FEPLT-2240
✨
Description by Callstackai
This PR introduces accessibility improvements to the Modal component, including support for
ariaLabel
,ariaLabelledby
, andariaDescribedby
attributes, as well as atriggerRef
prop for better focus management.Diagrams of code changes
Files Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.mdx
,.md
. See list of supported languages.