-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature/#10 modal focus trap #17
Conversation
lib/modal/modal.html
Outdated
|
||
<!-- Modal --> | ||
<div data-modal> | ||
<div id="dialog" data-modal-dialog role="dialog" aria-modal="true" aria-labelledby="modal title" tabindex="-1"> |
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.
Using aria-labelledby="modal title"
could mislead an inexperienced developer putting the modal title as value of the aria-labelledby
attribute. It should refer to element(s) that have the text needed for labeling.
I suggest applying an id to the <h3>
element and use the same for the aria-labelledby
attribute.
As a reference, this is the same approach used by WAI-ARIA.
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.
You're absolutely right.
The documentation you wrote is a nice way to guide the developer to the problem solution. Thank you @zetareticoli. |
* Fix: Accordion focus on closed panel child element (#14) * Fix: Accordion focus on closed tab child element * Updated accordion documentation * Added generated file Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com> * Feature/#10 modal focus trap (#17) * Added role and aria-modal attributes, adde x icon to close #10 * Added aria-labelledby #10 * Added tabindex to close button #10 * Added more documentation about Focus Trap and Page Scroll #10 * Change modal template #10 * Changed blockquote style #10 * Better doc #10 * Fixed aria-labelledby attribute #10 * Changed styel * Feature/#7 components docs (#18) * Added more content to Tabs doc #7 * Changed lead color #7 * Added support for :focus event on tooltips #7 * Changed Tooltips docs #7 * Show ring on focused tab panel's label (#20) Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com> * Removed container parent maintaining accessibility (#24) Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com> * Added focus ring on focused accordion item's label (#25) Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com> * Improved tabs accessibility (#23) Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com> * Removed accordion container from HTML preview #24 * Added information to CHANGELOG * Added upcoming release info * Added accessibility info for tabs * Bumped lib version for npm package * Fixed tabs accessibility doc Co-authored-by: Omar Muscatello <7016897+omaxel@users.noreply.github.com> Co-authored-by: Omar Muscatello <7016897+OmarMuscatello@users.noreply.github.com>
The focus trap issue couldn't be solved in pure CSS. It needs some Javascript.
So, I provided more info about both Focus Trap and Page Scroll Lock features, linking to highly rated npm packages, if needed.
I added the missing HTML
aria
androle
attributes on the modal container.Check this out and let me know if we need more changes before merge.