Skip to content
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: accept role as a prop #81

Open
imageck opened this issue Apr 24, 2023 · 2 comments · May be fixed by #82
Open

Modal: accept role as a prop #81

imageck opened this issue Apr 24, 2023 · 2 comments · May be fixed by #82

Comments

@imageck
Copy link

imageck commented Apr 24, 2023

Is your feature request related to a problem? Please describe

Currently, the role of modals is hard-coded to dialog. However, ARIA also describes an alertdialog role, which is perfect for confirmation prompts or alerts that require user interaction.

Describe the solution you'd like

The Modal component should accept a role prop. If it's set to alertdialog, ensure that "keyboard and mouse interactions only operate within the dialog".

Describe alternatives you've considered

Passing role as a prop to Modal does not work because it's passed to the child div instead.

Additional context

https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/

@jquense
Copy link
Member

jquense commented Apr 24, 2023

role seems to work for me in the examples:

image

image

There is one small detail that it incorrectly toggles aria-modal off if you do that, which we can fix. but Are you seeing different behavior here?

@imageck
Copy link
Author

imageck commented Apr 25, 2023

Apologies, @jquense. I meant to open this one for react-bootstrap. I think I mixed up the tabs. Would it be possible to move it?

Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants