focus-trap 7.6.3 β 7.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +21 -9
- package/dist/focus-trap.esm.js +24 -24
- package/dist/focus-trap.esm.js.map +1 -1
- package/dist/focus-trap.esm.min.js +2 -2
- package/dist/focus-trap.esm.min.js.map +1 -1
- package/dist/focus-trap.js +24 -24
- package/dist/focus-trap.js.map +1 -1
- package/dist/focus-trap.min.js +2 -2
- package/dist/focus-trap.min.js.map +1 -1
- package/dist/focus-trap.umd.js +24 -24
- package/dist/focus-trap.umd.js.map +1 -1
- package/dist/focus-trap.umd.min.js +2 -2
- package/dist/focus-trap.umd.min.js.map +1 -1
- package/index.js +1 -1
- package/package.json +26 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 7.6.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d51ad78: Allow activation element in shadow DOM to be auto-focused after trap is deactivated
|
|
8
|
+
|
|
9
|
+
## 7.6.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- bb47f7a: Remove engine requirement that crept into `package.json`. Sorry about that! ([#1343](https://github.com/focus-trap/focus-trap/issues/1343))
|
|
14
|
+
|
|
3
15
|
## 7.6.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# focus-trap [](https://github.com/focus-trap/focus-trap/actions?query=workflow:CI+branch:master) [](./LICENSE)
|
|
2
2
|
|
|
3
3
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
4
|
-
[](#contributors)
|
|
5
5
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
6
6
|
|
|
7
7
|
Trap focus within a DOM node.
|
|
@@ -231,6 +231,10 @@ Pause an active focus trap's event listening without deactivating the trap.
|
|
|
231
231
|
|
|
232
232
|
If the focus trap has not been activated, nothing happens.
|
|
233
233
|
|
|
234
|
+
Whether the trap is already paused or not, its paused state becomes __manually-paused__ even if the trap has already been auto-paused as a result of another trap being activated after this one (and so being higher on the stack than this one).
|
|
235
|
+
|
|
236
|
+
> Note that a manually-paused trap will not be auto-unpaused if it becomes the trap at the top of the `trapStack` again by way of all other traps higher than it on the stack being deactivated. It will remain paused until manually unpaused by calling `unpause()`. If the trap was auto-paused the entire time it was not at the top of the stack, then it will be auto-unpaused when it gets to the top of the stack again.
|
|
237
|
+
|
|
234
238
|
Returns the `trap`.
|
|
235
239
|
|
|
236
240
|
Any `onDeactivate` callback will not be called, and focus will not return to the element that was focused before the trap's activation. But the trap's behavior will be paused.
|
|
@@ -254,7 +258,11 @@ Unpause an active focus trap. (See `pause()`, above.)
|
|
|
254
258
|
|
|
255
259
|
Focus is forced into the trap just as described for `focusTrap.activate()`.
|
|
256
260
|
|
|
257
|
-
If the focus trap has not been activated
|
|
261
|
+
If the focus trap has not been activated, nothing happens.
|
|
262
|
+
|
|
263
|
+
If the focus trap has not been paused, nothing happens other than resetting its __manually-paused__ state.
|
|
264
|
+
|
|
265
|
+
If the focus trap is not at the top of the `trapStack`, it will not be unpaused (whether previously auto- or manually-paused) until all traps higher on the stack have been deactivated and this trap becomes the one at the top again.
|
|
258
266
|
|
|
259
267
|
Returns the `trap`.
|
|
260
268
|
|
|
@@ -380,44 +388,48 @@ In alphabetical order:
|
|
|
380
388
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andersthorsen"><img src="https://avatars.githubusercontent.com/u/190081?v=4?s=100" width="100px;" alt="Anders Thorsen"/><br /><sub><b>Anders Thorsen</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Aandersthorsen" title="Bug reports">π</a></td>
|
|
381
389
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bparish628"><img src="https://avatars1.githubusercontent.com/u/8492971?v=4?s=100" width="100px;" alt="Benjamin Parish"/><br /><sub><b>Benjamin Parish</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Abparish628" title="Bug reports">π</a></td>
|
|
382
390
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bernhardoj"><img src="https://avatars.githubusercontent.com/u/50919443?v=4?s=100" width="100px;" alt="Bernhard Owen Josephus"/><br /><sub><b>Bernhard Owen Josephus</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=bernhardoj" title="Code">π»</a></td>
|
|
391
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chrisbishop-looka"><img src="https://avatars.githubusercontent.com/u/128391384?v=4?s=100" width="100px;" alt="Chris Bishop"/><br /><sub><b>Chris Bishop</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Achrisbishop-looka" title="Bug reports">π</a></td>
|
|
383
392
|
<td align="center" valign="top" width="14.28%"><a href="https://clintgoodman.com"><img src="https://avatars3.githubusercontent.com/u/5473697?v=4?s=100" width="100px;" alt="Clint Goodman"/><br /><sub><b>Clint Goodman</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=cgood92" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=cgood92" title="Documentation">π</a> <a href="#example-cgood92" title="Examples">π‘</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=cgood92" title="Tests">β οΈ</a></td>
|
|
384
393
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Dan503"><img src="https://avatars.githubusercontent.com/u/10610368?v=4?s=100" width="100px;" alt="Daniel Tonon"/><br /><sub><b>Daniel Tonon</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=Dan503" title="Documentation">π</a> <a href="#tool-Dan503" title="Tools">π§</a> <a href="#a11y-Dan503" title="Accessibility">οΈοΈοΈοΈβΏοΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=Dan503" title="Code">π»</a></td>
|
|
385
394
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DaviDevMod"><img src="https://avatars.githubusercontent.com/u/98312056?v=4?s=100" width="100px;" alt="DaviDevMod"/><br /><sub><b>DaviDevMod</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=DaviDevMod" title="Documentation">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=DaviDevMod" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3ADaviDevMod" title="Bug reports">π</a></td>
|
|
386
|
-
<td align="center" valign="top" width="14.28%"><a href="http://davidtheclark.com/"><img src="https://avatars2.githubusercontent.com/u/628431?v=4?s=100" width="100px;" alt="David Clark"/><br /><sub><b>David Clark</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Adavidtheclark" title="Bug reports">π</a> <a href="#infra-davidtheclark" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Documentation">π</a> <a href="#maintenance-davidtheclark" title="Maintenance">π§</a></td>
|
|
387
395
|
</tr>
|
|
388
396
|
<tr>
|
|
397
|
+
<td align="center" valign="top" width="14.28%"><a href="http://davidtheclark.com/"><img src="https://avatars2.githubusercontent.com/u/628431?v=4?s=100" width="100px;" alt="David Clark"/><br /><sub><b>David Clark</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Adavidtheclark" title="Bug reports">π</a> <a href="#infra-davidtheclark" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=davidtheclark" title="Documentation">π</a> <a href="#maintenance-davidtheclark" title="Maintenance">π§</a></td>
|
|
389
398
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/features/security"><img src="https://avatars1.githubusercontent.com/u/27347476?v=4?s=100" width="100px;" alt="Dependabot"/><br /><sub><b>Dependabot</b></sub></a><br /><a href="#maintenance-dependabot" title="Maintenance">π§</a></td>
|
|
390
399
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jcfranco"><img src="https://avatars.githubusercontent.com/u/197440?v=4?s=100" width="100px;" alt="JC Franco"/><br /><sub><b>JC Franco</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=jcfranco" title="Code">π»</a></td>
|
|
391
400
|
<td align="center" valign="top" width="14.28%"><a href="https://www.schilljs.com/"><img src="https://avatars.githubusercontent.com/u/213943?v=4?s=100" width="100px;" alt="Joas Schilling"/><br /><sub><b>Joas Schilling</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/pulls?q=is%3Apr+reviewed-by%3Anickvergessen" title="Reviewed Pull Requests">π</a></td>
|
|
392
401
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/skjnldsv"><img src="https://avatars.githubusercontent.com/u/14975046?v=4?s=100" width="100px;" alt="John MolakvoΓ¦"/><br /><sub><b>John MolakvoΓ¦</b></sub></a><br /><a href="#ideas-skjnldsv" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
393
402
|
<td align="center" valign="top" width="14.28%"><a href="http://reload.dk"><img src="https://avatars.githubusercontent.com/u/73966?v=4?s=100" width="100px;" alt="Kasper GarnΓ¦s"/><br /><sub><b>Kasper GarnΓ¦s</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=kasperg" title="Documentation">π</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Akasperg" title="Bug reports">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=kasperg" title="Code">π»</a></td>
|
|
394
|
-
<td align="center" valign="top" width="14.28%"><a href="
|
|
395
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/msev"><img src="https://avatars.githubusercontent.com/u/1529562?v=4?s=100" width="100px;" alt="Maxime"/><br /><sub><b>Maxime</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Amsev" title="Bug reports">π</a></td>
|
|
403
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marioliu-block"><img src="https://avatars.githubusercontent.com/u/104794152?v=4?s=100" width="100px;" alt="Mario Liu"/><br /><sub><b>Mario Liu</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=marioliu-block" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Amarioliu-block" title="Bug reports">π</a></td>
|
|
396
404
|
</tr>
|
|
397
405
|
<tr>
|
|
406
|
+
<td align="center" valign="top" width="14.28%"><a href="http://blogs.esri.com/esri/arcgis/"><img src="https://avatars.githubusercontent.com/u/1231455?v=4?s=100" width="100px;" alt="Matt Driscoll"/><br /><sub><b>Matt Driscoll</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Adriskull" title="Bug reports">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=driskull" title="Code">π»</a> <a href="#tutorial-driskull" title="Tutorials">β
</a></td>
|
|
407
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/msev"><img src="https://avatars.githubusercontent.com/u/1529562?v=4?s=100" width="100px;" alt="Maxime"/><br /><sub><b>Maxime</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Amsev" title="Bug reports">π</a></td>
|
|
398
408
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/michael-ar"><img src="https://avatars3.githubusercontent.com/u/18557997?v=4?s=100" width="100px;" alt="Michael Reynolds"/><br /><sub><b>Michael Reynolds</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Amichael-ar" title="Bug reports">π</a></td>
|
|
399
409
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/liunate"><img src="https://avatars2.githubusercontent.com/u/38996291?v=4?s=100" width="100px;" alt="Nate Liu"/><br /><sub><b>Nate Liu</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=liunate" title="Tests">β οΈ</a></td>
|
|
400
410
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/far-fetched"><img src="https://avatars.githubusercontent.com/u/11621383?v=4?s=100" width="100px;" alt="Piotr Panek"/><br /><sub><b>Piotr Panek</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Afar-fetched" title="Bug reports">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=far-fetched" title="Documentation">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=far-fetched" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=far-fetched" title="Tests">β οΈ</a></td>
|
|
401
411
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/randypuro"><img src="https://avatars2.githubusercontent.com/u/2579?v=4?s=100" width="100px;" alt="Randy Puro"/><br /><sub><b>Randy Puro</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Arandypuro" title="Bug reports">π</a></td>
|
|
402
412
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sadick254"><img src="https://avatars2.githubusercontent.com/u/5238135?v=4?s=100" width="100px;" alt="Sadick"/><br /><sub><b>Sadick</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=sadick254" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=sadick254" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=sadick254" title="Documentation">π</a></td>
|
|
403
|
-
<td align="center" valign="top" width="14.28%"><a href="https://scottblinch.me/"><img src="https://avatars2.githubusercontent.com/u/4682114?v=4?s=100" width="100px;" alt="Scott Blinch"/><br /><sub><b>Scott Blinch</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=scottblinch" title="Documentation">π</a></td>
|
|
404
|
-
<td align="center" valign="top" width="14.28%"><a href="https://seanmcp.com/"><img src="https://avatars1.githubusercontent.com/u/6360367?v=4?s=100" width="100px;" alt="Sean McPherson"/><br /><sub><b>Sean McPherson</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=SeanMcP" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=SeanMcP" title="Documentation">π</a></td>
|
|
405
413
|
</tr>
|
|
406
414
|
<tr>
|
|
415
|
+
<td align="center" valign="top" width="14.28%"><a href="https://scottblinch.me/"><img src="https://avatars2.githubusercontent.com/u/4682114?v=4?s=100" width="100px;" alt="Scott Blinch"/><br /><sub><b>Scott Blinch</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=scottblinch" title="Documentation">π</a></td>
|
|
416
|
+
<td align="center" valign="top" width="14.28%"><a href="https://seanmcp.com/"><img src="https://avatars1.githubusercontent.com/u/6360367?v=4?s=100" width="100px;" alt="Sean McPherson"/><br /><sub><b>Sean McPherson</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=SeanMcP" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=SeanMcP" title="Documentation">π</a></td>
|
|
407
417
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/skriems"><img src="https://avatars.githubusercontent.com/u/15573317?v=4?s=100" width="100px;" alt="Sebastian Kriems"/><br /><sub><b>Sebastian Kriems</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Askriems" title="Bug reports">π</a></td>
|
|
408
418
|
<td align="center" valign="top" width="14.28%"><a href="https://recollectr.io"><img src="https://avatars2.githubusercontent.com/u/6835891?v=4?s=100" width="100px;" alt="Slapbox"/><br /><sub><b>Slapbox</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3ASlapbox" title="Bug reports">π</a></td>
|
|
409
419
|
<td align="center" valign="top" width="14.28%"><a href="https://stefancameron.com/"><img src="https://avatars3.githubusercontent.com/u/2855350?v=4?s=100" width="100px;" alt="Stefan Cameron"/><br /><sub><b>Stefan Cameron</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=stefcameron" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Astefcameron" title="Bug reports">π</a> <a href="#infra-stefcameron" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=stefcameron" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=stefcameron" title="Documentation">π</a> <a href="#maintenance-stefcameron" title="Maintenance">π§</a></td>
|
|
410
420
|
<td align="center" valign="top" width="14.28%"><a href="http://tylerhawkins.info/201R/"><img src="https://avatars0.githubusercontent.com/u/13806458?v=4?s=100" width="100px;" alt="Tyler Hawkins"/><br /><sub><b>Tyler Hawkins</b></sub></a><br /><a href="#tool-thawkin3" title="Tools">π§</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=thawkin3" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=thawkin3" title="Documentation">π</a></td>
|
|
411
421
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/vasiliki-b"><img src="https://avatars.githubusercontent.com/u/98032598?v=4?s=100" width="100px;" alt="Vasiliki Boutas"/><br /><sub><b>Vasiliki Boutas</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Avasiliki-b" title="Bug reports">π</a></td>
|
|
412
|
-
<td align="center" valign="top" width="14.28%"><a href="https://vinicius73.dev/"><img src="https://avatars.githubusercontent.com/u/1561347?v=4?s=100" width="100px;" alt="Vinicius Reis"/><br /><sub><b>Vinicius Reis</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=vinicius73" title="Code">π»</a> <a href="#ideas-vinicius73" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
413
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wandroll"><img src="https://avatars.githubusercontent.com/u/4492317?v=4?s=100" width="100px;" alt="Wandrille Verlut"/><br /><sub><b>Wandrille Verlut</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Documentation">π</a> <a href="#tool-wandroll" title="Tools">π§</a></td>
|
|
414
422
|
</tr>
|
|
415
423
|
<tr>
|
|
424
|
+
<td align="center" valign="top" width="14.28%"><a href="https://vinicius73.dev/"><img src="https://avatars.githubusercontent.com/u/1561347?v=4?s=100" width="100px;" alt="Vinicius Reis"/><br /><sub><b>Vinicius Reis</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=vinicius73" title="Code">π»</a> <a href="#ideas-vinicius73" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
425
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wandroll"><img src="https://avatars.githubusercontent.com/u/4492317?v=4?s=100" width="100px;" alt="Wandrille Verlut"/><br /><sub><b>Wandrille Verlut</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Tests">β οΈ</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=wandroll" title="Documentation">π</a> <a href="#tool-wandroll" title="Tools">π§</a></td>
|
|
416
426
|
<td align="center" valign="top" width="14.28%"><a href="http://willmruzek.com/"><img src="https://avatars.githubusercontent.com/u/108522?v=4?s=100" width="100px;" alt="Will Mruzek"/><br /><sub><b>Will Mruzek</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=mruzekw" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=mruzekw" title="Documentation">π</a> <a href="#example-mruzekw" title="Examples">π‘</a> <a href="https://github.com/focus-trap/focus-trap/commits?author=mruzekw" title="Tests">β οΈ</a> <a href="#question-mruzekw" title="Answering Questions">π¬</a></td>
|
|
417
427
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zioth"><img src="https://avatars3.githubusercontent.com/u/945603?v=4?s=100" width="100px;" alt="Zioth"/><br /><sub><b>Zioth</b></sub></a><br /><a href="#ideas-zioth" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Azioth" title="Bug reports">π</a></td>
|
|
418
428
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/glushkova91"><img src="https://avatars.githubusercontent.com/u/13402897?v=4?s=100" width="100px;" alt="glushkova91"/><br /><sub><b>glushkova91</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=glushkova91" title="Documentation">π</a></td>
|
|
419
429
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jpveooys"><img src="https://avatars.githubusercontent.com/u/66470099?v=4?s=100" width="100px;" alt="jpveooys"/><br /><sub><b>jpveooys</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Ajpveooys" title="Bug reports">π</a></td>
|
|
420
430
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/konradr33"><img src="https://avatars.githubusercontent.com/u/32595283?v=4?s=100" width="100px;" alt="konradr33"/><br /><sub><b>konradr33</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Akonradr33" title="Bug reports">π</a></td>
|
|
431
|
+
</tr>
|
|
432
|
+
<tr>
|
|
421
433
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tomasvn"><img src="https://avatars.githubusercontent.com/u/17225564?v=4?s=100" width="100px;" alt="tomasvn"/><br /><sub><b>tomasvn</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=tomasvn" title="Code">π»</a></td>
|
|
422
434
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/simonxabris"><img src="https://avatars.githubusercontent.com/u/27497229?v=4?s=100" width="100px;" alt="Γbris Simon"/><br /><sub><b>Γbris Simon</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/commits?author=simonxabris" title="Code">π»</a> <a href="https://github.com/focus-trap/focus-trap/issues?q=author%3Asimonxabris" title="Bug reports">π</a></td>
|
|
423
435
|
</tr>
|
package/dist/focus-trap.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* focus-trap 7.6.
|
|
2
|
+
* focus-trap 7.6.5
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
4
4
|
*/
|
|
5
5
|
import { tabbable, focusable, isTabbable, getTabIndex, isFocusable } from 'tabbable';
|
|
@@ -53,8 +53,8 @@ function _toConsumableArray(r) {
|
|
|
53
53
|
function _toPrimitive(t, r) {
|
|
54
54
|
if ("object" != typeof t || !t) return t;
|
|
55
55
|
var e = t[Symbol.toPrimitive];
|
|
56
|
-
if (
|
|
57
|
-
var i = e.call(t, r
|
|
56
|
+
if (void 0 !== e) {
|
|
57
|
+
var i = e.call(t, r);
|
|
58
58
|
if ("object" != typeof i) return i;
|
|
59
59
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
60
60
|
}
|
|
@@ -68,7 +68,7 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
68
68
|
if (r) {
|
|
69
69
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
70
70
|
var t = {}.toString.call(r).slice(8, -1);
|
|
71
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) :
|
|
71
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -103,10 +103,10 @@ var isSelectableInput = function isSelectableInput(node) {
|
|
|
103
103
|
return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';
|
|
104
104
|
};
|
|
105
105
|
var isEscapeEvent = function isEscapeEvent(e) {
|
|
106
|
-
return (e === null || e ===
|
|
106
|
+
return (e === null || e === void 0 ? void 0 : e.key) === 'Escape' || (e === null || e === void 0 ? void 0 : e.key) === 'Esc' || (e === null || e === void 0 ? void 0 : e.keyCode) === 27;
|
|
107
107
|
};
|
|
108
108
|
var isTabEvent = function isTabEvent(e) {
|
|
109
|
-
return (e === null || e ===
|
|
109
|
+
return (e === null || e === void 0 ? void 0 : e.key) === 'Tab' || (e === null || e === void 0 ? void 0 : e.keyCode) === 9;
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
// checks for TAB by default
|
|
@@ -133,7 +133,7 @@ var valueOrHandler = function valueOrHandler(value) {
|
|
|
133
133
|
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
134
134
|
params[_key - 1] = arguments[_key];
|
|
135
135
|
}
|
|
136
|
-
return typeof value === 'function' ? value.apply(
|
|
136
|
+
return typeof value === 'function' ? value.apply(void 0, params) : value;
|
|
137
137
|
};
|
|
138
138
|
var getActualTarget = function getActualTarget(event) {
|
|
139
139
|
// NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the
|
|
@@ -152,8 +152,8 @@ var internalTrapStack = [];
|
|
|
152
152
|
var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
153
153
|
// SSR: a live trap shouldn't be created in this type of environment so this
|
|
154
154
|
// should be safe code to execute if the `document` option isn't specified
|
|
155
|
-
var doc = (userOptions === null || userOptions ===
|
|
156
|
-
var trapStack = (userOptions === null || userOptions ===
|
|
155
|
+
var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;
|
|
156
|
+
var trapStack = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.trapStack) || internalTrapStack;
|
|
157
157
|
var config = _objectSpread2({
|
|
158
158
|
returnFocusOnDeactivate: true,
|
|
159
159
|
escapeDeactivates: true,
|
|
@@ -225,7 +225,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
225
225
|
* if the element isn't found.
|
|
226
226
|
*/
|
|
227
227
|
var findContainerIndex = function findContainerIndex(element, event) {
|
|
228
|
-
var composedPath = typeof (event === null || event ===
|
|
228
|
+
var composedPath = typeof (event === null || event === void 0 ? void 0 : event.composedPath) === 'function' ? event.composedPath() : undefined;
|
|
229
229
|
// NOTE: search `containerGroups` because it's possible a group contains no tabbable
|
|
230
230
|
// nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)
|
|
231
231
|
// and we still need to find the element in there
|
|
@@ -236,7 +236,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
236
236
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
237
237
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
238
238
|
// look inside web components even if open)
|
|
239
|
-
composedPath === null || composedPath ===
|
|
239
|
+
composedPath === null || composedPath === void 0 ? void 0 : composedPath.includes(container)) || tabbableNodes.find(function (node) {
|
|
240
240
|
return node === element;
|
|
241
241
|
});
|
|
242
242
|
});
|
|
@@ -263,12 +263,12 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
263
263
|
var getNodeForOption = function getNodeForOption(optionName) {
|
|
264
264
|
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
265
265
|
_ref2$hasFallback = _ref2.hasFallback,
|
|
266
|
-
hasFallback = _ref2$hasFallback ===
|
|
266
|
+
hasFallback = _ref2$hasFallback === void 0 ? false : _ref2$hasFallback,
|
|
267
267
|
_ref2$params = _ref2.params,
|
|
268
|
-
params = _ref2$params ===
|
|
268
|
+
params = _ref2$params === void 0 ? [] : _ref2$params;
|
|
269
269
|
var optionValue = config[optionName];
|
|
270
270
|
if (typeof optionValue === 'function') {
|
|
271
|
-
optionValue = optionValue.apply(
|
|
271
|
+
optionValue = optionValue.apply(void 0, _toConsumableArray(params));
|
|
272
272
|
}
|
|
273
273
|
if (optionValue === true) {
|
|
274
274
|
optionValue = undefined; // use default value
|
|
@@ -484,7 +484,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
484
484
|
var target = _ref3.target,
|
|
485
485
|
event = _ref3.event,
|
|
486
486
|
_ref3$isBackward = _ref3.isBackward,
|
|
487
|
-
isBackward = _ref3$isBackward ===
|
|
487
|
+
isBackward = _ref3$isBackward === void 0 ? false : _ref3$isBackward;
|
|
488
488
|
target = target || getActualTarget(event);
|
|
489
489
|
updateTabbableNodes();
|
|
490
490
|
var destinationNode = null;
|
|
@@ -865,15 +865,15 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
865
865
|
}
|
|
866
866
|
state.active = true;
|
|
867
867
|
state.paused = false;
|
|
868
|
-
state.nodeFocusedBeforeActivation = doc
|
|
869
|
-
onActivate === null || onActivate ===
|
|
868
|
+
state.nodeFocusedBeforeActivation = _getActiveElement(doc);
|
|
869
|
+
onActivate === null || onActivate === void 0 || onActivate();
|
|
870
870
|
var finishActivation = function finishActivation() {
|
|
871
871
|
if (checkCanFocusTrap) {
|
|
872
872
|
updateTabbableNodes();
|
|
873
873
|
}
|
|
874
874
|
addListeners();
|
|
875
875
|
updateObservedNodes();
|
|
876
|
-
onPostActivate === null || onPostActivate ===
|
|
876
|
+
onPostActivate === null || onPostActivate === void 0 || onPostActivate();
|
|
877
877
|
};
|
|
878
878
|
if (checkCanFocusTrap) {
|
|
879
879
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
@@ -902,13 +902,13 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
902
902
|
var onPostDeactivate = getOption(options, 'onPostDeactivate');
|
|
903
903
|
var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');
|
|
904
904
|
var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');
|
|
905
|
-
onDeactivate === null || onDeactivate ===
|
|
905
|
+
onDeactivate === null || onDeactivate === void 0 || onDeactivate();
|
|
906
906
|
var finishDeactivation = function finishDeactivation() {
|
|
907
907
|
delay(function () {
|
|
908
908
|
if (returnFocus) {
|
|
909
909
|
_tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));
|
|
910
910
|
}
|
|
911
|
-
onPostDeactivate === null || onPostDeactivate ===
|
|
911
|
+
onPostDeactivate === null || onPostDeactivate === void 0 || onPostDeactivate();
|
|
912
912
|
});
|
|
913
913
|
};
|
|
914
914
|
if (returnFocus && checkCanReturnFocus) {
|
|
@@ -962,18 +962,18 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
962
962
|
if (paused) {
|
|
963
963
|
var onPause = getOption(options, 'onPause');
|
|
964
964
|
var onPostPause = getOption(options, 'onPostPause');
|
|
965
|
-
onPause === null || onPause ===
|
|
965
|
+
onPause === null || onPause === void 0 || onPause();
|
|
966
966
|
removeListeners();
|
|
967
967
|
updateObservedNodes();
|
|
968
|
-
onPostPause === null || onPostPause ===
|
|
968
|
+
onPostPause === null || onPostPause === void 0 || onPostPause();
|
|
969
969
|
} else {
|
|
970
970
|
var onUnpause = getOption(options, 'onUnpause');
|
|
971
971
|
var onPostUnpause = getOption(options, 'onPostUnpause');
|
|
972
|
-
onUnpause === null || onUnpause ===
|
|
972
|
+
onUnpause === null || onUnpause === void 0 || onUnpause();
|
|
973
973
|
updateTabbableNodes();
|
|
974
974
|
addListeners();
|
|
975
975
|
updateObservedNodes();
|
|
976
|
-
onPostUnpause === null || onPostUnpause ===
|
|
976
|
+
onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause();
|
|
977
977
|
}
|
|
978
978
|
return this;
|
|
979
979
|
}
|