-
Notifications
You must be signed in to change notification settings - Fork 47
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
🚀 feat(Dialog): improve accessibility #849
Conversation
Quality Gate passedIssues Measures |
lockProps={lockProps} | ||
returnFocus | ||
disabled={!isOpen} | ||
className={className} |
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.
What is the use of className here? Can this allow style customization?
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 purpose was to maintain compatibility with the current API of the component to avoid any side effects. Currently all props are passed to the Dialog
, I kept this behavior in the lockProps
, but the className
is not accepted in this prop, which is why I had to create this exception.
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 understand, I think we can keep this prop for now for safety and in the future we make it more restricted, no problem.
Description 📄
Add
react-focus-lock
library to@gympass/yoga
package, with this library the following features were added toDialog
,BottomSheet
andDrawer
components:Dialog
when it is opened, that way the user can't move the focus away from theDialog
.Add props
role="dialog"
andaria-modal=true
toDialog
component.Add
closeLabel
prop to be used as thearia-label
from close button.Platforms 📲
Type of change 🔍
How Has This Been Tested? 🧪
[Enter the tips to test this PR]
Checklist: 🔍
Screenshots 📸
Default behavior
Screen.Recording.2024-11-18.at.16.42.58.mov
New screen reader behavior
Screen.Recording.2024-11-18.at.16.41.37.mov
Current screen reader behavior
Screen.Recording.2024-11-18.at.16.52.46.mov