Open joshwooding opened 1 week ago
@joshwooding Given it is a modal dialog, focus should be moved into the modal dialog and trap focus while preventing interactions outside the dialog. When closed by either a close button or esc key, focus needs to be placed back on the button or element that triggered the overlay.
@joshwooding Given it is a modal dialog, focus should be moved into the modal dialog and trap focus while preventing interactions outside the dialog. When closed by either a close button or esc key, focus needs to be placed back on the button or element that triggered the overlay.
Is the same behaviour fine if it's open by default and should we recommend to only have one open at a time or is there no difference?
Is the same behaviour fine if it's open by default
I would not recommend having it open by default.
should we recommend to only have one open at a time or is there no difference?
Yes, only 1 should be open at a time.
Some weird question - what should happen if the overlay doesn't have a close button and the user is not using a keyboard (no "Esc" key)... how to simulate "click outside" feature...?
Some weird question - what should happen if the overlay doesn't have a close button and the user is not using a keyboard (no "Esc" key)... how to simulate "click outside" feature...?
Great question, APG Dialog (Modal) Pattern strongly recommends that all dialogs include a visible element with role button that closes the dialog, such as a close icon or cancel button.
That said, most assistive technologies map to keyboard inputs so they can still perform esc functionality to close the modal dialog even if they don't use a physical keyboard or mouse. For users that use speech recognition software, they can say "Dismiss" or "Press esc". And users that rely on head or eye tracking systems function like a mouse, allowing them to "click outside" the modal to close it.
How should an overlay that is open by default behave? Currently it pulls focus but should it wait to trap focus inside it.
You can sort of test it here: https://storybook.saltdesignsystem.com/?path=/story/core-overlay-overlay-qa--default