-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Toast: Should be focused when is opened and close on ESC #16026
Comments
Changing the current behavior could have negative impact to the "usability" of toast if the focus is automatically lost when a toast notification is generated at the start/middle/end of a user action.
If a change to the current toast functionality is actually required, I would recommend adding a new (non default) option that enables the new proposed change. |
For accessibility the implementation is necessary because disabled people using keyboards cannot read/scan close the popup. |
I agree that my comments only addressed the closing issue which I claim the current PrimeNG toast functionality is accessible. I don't know enough about accessibility to address the read/scan issue. "Stealing" focus from a user |
I performed a quick search on toast and accessability. I found: https://sheribyrnehaber.medium.com/designing-toast-messages-for-accessibility-fb610ac364be |
Thanks, but I'm sure PrimeNG team will follow Material Design guide to solve this problem. They are explaining everything about the focus action. |
@SoyDiego I have created the following reproducer: https://stackblitz.com/edit/uqdfhq. The reproducer implements the use-case where notifications are automatically displayed while a user types information in an input text. The notifications must not interrupt the user's typing. If PR #16078 breaks the reproducer, I would recommend adding a flag to Toast's API that enables/disables auto focus of toast. Please see the video below, which shows the reproducer working properly in PrimeNG v17.8.5. toastAndInputText.mov |
Thanks for check it. I'm not deciding this things. I was talking with @cetincakiroglu about this implementation in my PR. Thanks again :) |
@SoyDiego |
I will try to add it tomorrow. Thanks! |
Hi, So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap? Thanks a lot for your understanding! |
Describe the bug
To follow accessibility rules, the toast component should receive focus when opened and allow the user to access the text by pressing the Tab key so they can read the content. Additionally, it should be closable by pressing the ESC key.
Environment
Reproducer
No response
Angular version
18
PrimeNG version
Last version
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: