-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { createFocusTrap as _createFocusTrap } from 'focus-trap'; | ||
|
||
/** | ||
* Creates a focus trap for the given element with the given options. | ||
* | ||
* This function applies some default options that are different to the library. | ||
* Your own options still override these custom defaults: | ||
* | ||
* ```json | ||
* { | ||
escapeDeactivates: false, | ||
* } | ||
* ``` | ||
* | ||
* @param element The element to be the focus trap, or a selector that will be used to find the element. | ||
* | ||
* @see https://github.com/focus-trap/focus-trap#readme - Library documentation | ||
*/ | ||
function createFocusTrap(...args: Parameters<typeof _createFocusTrap>): ReturnType<typeof _createFocusTrap> { | ||
args[1] = { | ||
escapeDeactivates: false, | ||
...args[1], | ||
}; | ||
|
||
return _createFocusTrap(...args); | ||
} | ||
|
||
export * from 'focus-trap'; | ||
export { createFocusTrap }; |
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