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

Rework show for alerts #6687

Open
imageck opened this issue Sep 4, 2023 · 0 comments
Open

Rework show for alerts #6687

imageck opened this issue Sep 4, 2023 · 0 comments

Comments

@imageck
Copy link
Contributor

imageck commented Sep 4, 2023

Is your feature request related to a problem? Please describe

Currently, if it is false, then the component is not rendered. This behavior fails the test for Technique ARIA19.

Describe the solution you'd like

When the page is loaded, the alert container should be present in the DOM but empty and hidden.

Describe alternatives you've considered

Instead, the show prop could be used to determine whether to apply display: none or not. It could also be deprecated in favor of the native hidden attribute, thus leaving it to authors to implement. Another technique is to tie its visibility to the presence of the content inside, hiding it when it's empty. The author would only need to update the alert's content, its visibility would be handled automatically.

Additional context

https://www.w3.org/WAI/ARIA/apg/patterns/alert/examples/alert/
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role
https://www.w3.org/TR/selectors-4/#the-empty-pseudo

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

No branches or pull requests

1 participant