-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: various ARIA enhancements for Overlay (Dialog & Drawer) (#85)
* feat: various ARIA enhancements for Overlay (Dialog & Drawer) * test: resolve focus trap issue
- Loading branch information
1 parent
4729910
commit b081ea2
Showing
8 changed files
with
95 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Solution taken from: | ||
// https://github.com/focus-trap/tabbable#testing-in-jsdom | ||
|
||
const lib = jest.requireActual('tabbable'); | ||
|
||
const tabbable = { | ||
...lib, | ||
tabbable: (node, options) => lib.tabbable(node, { ...options, displayCheck: 'none' }), | ||
focusable: (node, options) => lib.focusable(node, { ...options, displayCheck: 'none' }), | ||
isFocusable: (node, options) => lib.isFocusable(node, { ...options, displayCheck: 'none' }), | ||
isTabbable: (node, options) => lib.isTabbable(node, { ...options, displayCheck: 'none' }), | ||
}; | ||
|
||
module.exports = tabbable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,11 @@ export const Default = () => { | |
return ( | ||
<> | ||
<button onClick={() => setIsOpen(!isOpen)}>Toggle Dialog</button> | ||
<Dialog isOpen={isOpen} onClose={() => setIsOpen(false)}> | ||
<Dialog.Header> | ||
<Dialog isOpen={isOpen} onClose={() => setIsOpen(false)} ariaLabelledBy="conf-needed" ariaDescribedBy="conf-details"> | ||
<Dialog.Header id="conf-needed"> | ||
Confirmation needed | ||
</Dialog.Header> | ||
<Dialog.Content> | ||
<Dialog.Content id="conf-details"> | ||
<p>An email has been sent to [email protected]</p> | ||
<p>Please click on the link in the email we sent you in order to complete account creation.</p> | ||
</Dialog.Content> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters