focus-trap 7.7.1 β 8.0.0
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 +21 -0
- package/README.md +10 -9
- package/dist/focus-trap.esm.js +258 -39
- package/dist/focus-trap.esm.js.map +1 -1
- package/dist/focus-trap.esm.min.js +4 -2
- package/dist/focus-trap.esm.min.js.map +1 -1
- package/dist/focus-trap.js +257 -38
- package/dist/focus-trap.js.map +1 -1
- package/dist/focus-trap.min.js +4 -2
- package/dist/focus-trap.min.js.map +1 -1
- package/dist/focus-trap.umd.js +257 -38
- package/dist/focus-trap.umd.js.map +1 -1
- package/dist/focus-trap.umd.min.js +4 -2
- package/dist/focus-trap.umd.min.js.map +1 -1
- package/index.d.ts +4 -4
- package/index.js +94 -33
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- b6ea4b5: **Breaking:** Fixed a long-standing bug where `onPostActivate()` would be called _before_ the initial focus node was focused and the trap was fully activated. ([#1747](https://github.com/focus-trap/focus-trap/issues/1747))
|
|
8
|
+
- By default (and for many years now), a trap delays setting focus to the initial focus node to the next frame (`setTimeout(0)`) but wasn't delaying calling `onPostActivate()` until after that delay.
|
|
9
|
+
- With the new `isolateSubtrees='aria-hidden'` option, the currently-focused node's container (a non-subtree being "disabled") would get hidden before the delay was up, resulting in Chrome preventing the effect of `aria-hidden` on that subtree with a warning in the console due to the container being hidden still containing focus (e.g. the "activate trap" button).
|
|
10
|
+
- **With the fix**, subtree isolation and the call to `onPostActivate()` await the initial focus delay (if there is one, which is default behavior; remove it with `delayInitialFocus=false`) before being applied/called.
|
|
11
|
+
- This may cause tests to fail, requiring the addition of slight delays before testing a given state (e.g. `await waitFor(() => expect(initialFocusNode).toBeFocused())`.
|
|
12
|
+
- It may also disrupt current assumptions about the state of the initial focus node in code that runs in your `onPostActivate()` handler (prior to this change, that node would **not** be focused yet; after this change, **it will be focused**).
|
|
13
|
+
|
|
14
|
+
## 7.8.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- c214581: Adds aria-hidden support to isolateSubtrees config option
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- bb36e15: Fix undefined method `_setSubtreeIsolation` crash when using `trapStack` in DOM with older versions of Focus-trap ([#1729](https://github.com/focus-trap/focus-trap/issues/1729))
|
|
23
|
+
|
|
3
24
|
## 7.7.1
|
|
4
25
|
|
|
5
26
|
### 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.
|
|
@@ -274,14 +274,14 @@ Default: `true`. Delays the autofocus to the next execution frame when the focus
|
|
|
274
274
|
##### isolateSubtrees
|
|
275
275
|
|
|
276
276
|
```typescript
|
|
277
|
-
boolean
|
|
277
|
+
boolean | 'inert' | 'aria-hidden'
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
-
Default: `false`. Isolates the portion of the DOM tree containing the focus trap when activated. This prevents screen readers and other assistive technologies from accessing page content outside of the trap. When the trap is deactivated, any elements that were `inert` prior to activation will be left
|
|
280
|
+
Default: `false`. Isolates the portion of the DOM tree containing the focus trap when activated. This prevents screen readers and other assistive technologies from accessing page content outside of the trap. `"aria-hidden"` will utilize the `aria-hidden` attribute. `true`, `"inert"`, and all other truthy values will use the `inert` attribute. When the trap is deactivated, any elements that were `inert` or `aria-hidden` prior to activation will be left in their original state.
|
|
281
281
|
|
|
282
|
-
πΊ Note that when this option
|
|
282
|
+
πΊ Note that when this option uses `inert`, all user interactions outside of the trapped element are prevented and content will be inaccessible to screen readers. This prevents the use of the `clickOutsideDeactivates` feature.
|
|
283
283
|
|
|
284
|
-
πΊ Note that when this option is
|
|
284
|
+
πΊ Note that when this option is used and the trap is activated, elements that are siblings to either the trap's container or any of its ancestor elements have `inert` or `aria-hidden` applied. If any of these elements is already `inert` or `aria-hidden`, the trap will not remove the attribute from that element when deactivating the trap. Manual changes to these attributes while a trap is active is likely to cause headaches.
|
|
285
285
|
|
|
286
286
|
##### document
|
|
287
287
|
|
|
@@ -586,39 +586,40 @@ In alphabetical order:
|
|
|
586
586
|
<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>
|
|
587
587
|
<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>
|
|
588
588
|
<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>
|
|
589
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ShGKme"><img src="https://avatars.githubusercontent.com/u/25978914?v=4?s=100" width="100px;" alt="Grigorii K. Shartsev"/><br /><sub><b>Grigorii K. Shartsev</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap/issues?q=author%3AShGKme" title="Bug reports">π</a></td>
|
|
589
590
|
<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>
|
|
590
591
|
<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>
|
|
591
592
|
<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>
|
|
592
|
-
<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>
|
|
593
593
|
</tr>
|
|
594
594
|
<tr>
|
|
595
|
+
<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>
|
|
595
596
|
<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>
|
|
596
597
|
<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>
|
|
597
598
|
<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>
|
|
598
599
|
<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>
|
|
599
600
|
<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>
|
|
600
601
|
<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>
|
|
601
|
-
<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>
|
|
602
602
|
</tr>
|
|
603
603
|
<tr>
|
|
604
|
+
<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>
|
|
604
605
|
<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>
|
|
605
606
|
<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>
|
|
606
607
|
<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>
|
|
607
608
|
<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>
|
|
608
609
|
<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>
|
|
609
610
|
<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>
|
|
610
|
-
<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>
|
|
611
611
|
</tr>
|
|
612
612
|
<tr>
|
|
613
|
+
<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>
|
|
613
614
|
<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>
|
|
614
615
|
<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>
|
|
615
616
|
<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>
|
|
616
617
|
<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>
|
|
617
618
|
<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>
|
|
618
619
|
<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>
|
|
619
|
-
<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>
|
|
620
620
|
</tr>
|
|
621
621
|
<tr>
|
|
622
|
+
<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>
|
|
622
623
|
<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>
|
|
623
624
|
<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>
|
|
624
625
|
<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>
|
package/dist/focus-trap.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* focus-trap
|
|
2
|
+
* focus-trap 8.0.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
4
4
|
*/
|
|
5
|
-
import { tabbable, focusable, isTabbable, getTabIndex
|
|
5
|
+
import { isFocusable, tabbable, focusable, isTabbable, getTabIndex } from 'tabbable';
|
|
6
6
|
|
|
7
7
|
function _arrayLikeToArray(r, a) {
|
|
8
8
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -12,6 +12,31 @@ function _arrayLikeToArray(r, a) {
|
|
|
12
12
|
function _arrayWithoutHoles(r) {
|
|
13
13
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
14
14
|
}
|
|
15
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
16
|
+
try {
|
|
17
|
+
var i = n[a](c),
|
|
18
|
+
u = i.value;
|
|
19
|
+
} catch (n) {
|
|
20
|
+
return void e(n);
|
|
21
|
+
}
|
|
22
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
23
|
+
}
|
|
24
|
+
function _asyncToGenerator(n) {
|
|
25
|
+
return function () {
|
|
26
|
+
var t = this,
|
|
27
|
+
e = arguments;
|
|
28
|
+
return new Promise(function (r, o) {
|
|
29
|
+
var a = n.apply(t, e);
|
|
30
|
+
function _next(n) {
|
|
31
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
32
|
+
}
|
|
33
|
+
function _throw(n) {
|
|
34
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
35
|
+
}
|
|
36
|
+
_next(void 0);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
15
40
|
function _createForOfIteratorHelper(r, e) {
|
|
16
41
|
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
17
42
|
if (!t) {
|
|
@@ -95,6 +120,114 @@ function _objectSpread2(e) {
|
|
|
95
120
|
}
|
|
96
121
|
return e;
|
|
97
122
|
}
|
|
123
|
+
function _regenerator() {
|
|
124
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
125
|
+
var e,
|
|
126
|
+
t,
|
|
127
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
128
|
+
n = r.iterator || "@@iterator",
|
|
129
|
+
o = r.toStringTag || "@@toStringTag";
|
|
130
|
+
function i(r, n, o, i) {
|
|
131
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
132
|
+
u = Object.create(c.prototype);
|
|
133
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
134
|
+
var i,
|
|
135
|
+
c,
|
|
136
|
+
u,
|
|
137
|
+
f = 0,
|
|
138
|
+
p = o || [],
|
|
139
|
+
y = false,
|
|
140
|
+
G = {
|
|
141
|
+
p: 0,
|
|
142
|
+
n: 0,
|
|
143
|
+
v: e,
|
|
144
|
+
a: d,
|
|
145
|
+
f: d.bind(e, 4),
|
|
146
|
+
d: function (t, r) {
|
|
147
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
function d(r, n) {
|
|
151
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
152
|
+
var o,
|
|
153
|
+
i = p[t],
|
|
154
|
+
d = G.p,
|
|
155
|
+
l = i[2];
|
|
156
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
157
|
+
}
|
|
158
|
+
if (o || r > 1) return a;
|
|
159
|
+
throw y = true, n;
|
|
160
|
+
}
|
|
161
|
+
return function (o, p, l) {
|
|
162
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
163
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
164
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
165
|
+
try {
|
|
166
|
+
if (f = 2, i) {
|
|
167
|
+
if (c || (o = "next"), t = i[o]) {
|
|
168
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
169
|
+
if (!t.done) return t;
|
|
170
|
+
u = t.value, c < 2 && (c = 0);
|
|
171
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
172
|
+
i = e;
|
|
173
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
174
|
+
} catch (t) {
|
|
175
|
+
i = e, c = 1, u = t;
|
|
176
|
+
} finally {
|
|
177
|
+
f = 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
value: t,
|
|
182
|
+
done: y
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
}(r, o, i), true), u;
|
|
186
|
+
}
|
|
187
|
+
var a = {};
|
|
188
|
+
function Generator() {}
|
|
189
|
+
function GeneratorFunction() {}
|
|
190
|
+
function GeneratorFunctionPrototype() {}
|
|
191
|
+
t = Object.getPrototypeOf;
|
|
192
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
193
|
+
return this;
|
|
194
|
+
}), t),
|
|
195
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
196
|
+
function f(e) {
|
|
197
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
198
|
+
}
|
|
199
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
200
|
+
return this;
|
|
201
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
202
|
+
return "[object Generator]";
|
|
203
|
+
}), (_regenerator = function () {
|
|
204
|
+
return {
|
|
205
|
+
w: i,
|
|
206
|
+
m: f
|
|
207
|
+
};
|
|
208
|
+
})();
|
|
209
|
+
}
|
|
210
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
211
|
+
var i = Object.defineProperty;
|
|
212
|
+
try {
|
|
213
|
+
i({}, "", {});
|
|
214
|
+
} catch (e) {
|
|
215
|
+
i = 0;
|
|
216
|
+
}
|
|
217
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
218
|
+
function o(r, n) {
|
|
219
|
+
_regeneratorDefine(e, r, function (e) {
|
|
220
|
+
return this._invoke(r, n, e);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
r ? i ? i(e, r, {
|
|
224
|
+
value: n,
|
|
225
|
+
enumerable: !t,
|
|
226
|
+
configurable: !t,
|
|
227
|
+
writable: !t
|
|
228
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
229
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
230
|
+
}
|
|
98
231
|
function _toConsumableArray(r) {
|
|
99
232
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
100
233
|
}
|
|
@@ -259,9 +392,9 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
259
392
|
// references to nodes that are siblings to the ancestors of this trap's containers.
|
|
260
393
|
/** @type {Set<HTMLElement>} */
|
|
261
394
|
adjacentElements: new Set(),
|
|
262
|
-
// references to nodes that were inert before the trap was activated.
|
|
395
|
+
// references to nodes that were inert or aria-hidden before the trap was activated.
|
|
263
396
|
/** @type {Set<HTMLElement>} */
|
|
264
|
-
|
|
397
|
+
alreadySilent: new Set(),
|
|
265
398
|
nodeFocusedBeforeActivation: null,
|
|
266
399
|
mostRecentlyFocusedNode: null,
|
|
267
400
|
active: false,
|
|
@@ -649,7 +782,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
649
782
|
var checkPointerDown = function checkPointerDown(e) {
|
|
650
783
|
var target = getActualTarget(e);
|
|
651
784
|
if (findContainerIndex(target, e) >= 0) {
|
|
652
|
-
// allow the click since it
|
|
785
|
+
// allow the click since it occurred inside the trap
|
|
653
786
|
return;
|
|
654
787
|
}
|
|
655
788
|
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
|
|
@@ -832,9 +965,15 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
832
965
|
// EVENT LISTENERS
|
|
833
966
|
//
|
|
834
967
|
|
|
968
|
+
/**
|
|
969
|
+
* Adds listeners to the document necessary for trapping focus and attempts to set focus
|
|
970
|
+
* to the configured initial focus node. Does nothing if the trap isn't active.
|
|
971
|
+
* @returns {Promise<void>} Resolved (always) once the initial focus node has been focused.
|
|
972
|
+
* Also resolved if the trap isn't active.
|
|
973
|
+
*/
|
|
835
974
|
var addListeners = function addListeners() {
|
|
836
975
|
if (!state.active) {
|
|
837
|
-
return;
|
|
976
|
+
return Promise.resolve();
|
|
838
977
|
}
|
|
839
978
|
|
|
840
979
|
// There can be only one listening focus trap at a time
|
|
@@ -842,9 +981,21 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
842
981
|
|
|
843
982
|
// Delay ensures that the focused element doesn't capture the event
|
|
844
983
|
// that caused the focus trap activation.
|
|
845
|
-
|
|
984
|
+
/** @type {Promise<void>} */
|
|
985
|
+
var promise;
|
|
986
|
+
if (config.delayInitialFocus) {
|
|
987
|
+
// NOTE: Promise constructor callback is called synchronously, which is what we want
|
|
988
|
+
// since we need to capture the timer ID immediately
|
|
989
|
+
promise = new Promise(function (resolve) {
|
|
990
|
+
state.delayInitialFocusTimer = delay(function () {
|
|
991
|
+
_tryFocus(getInitialFocusNode());
|
|
992
|
+
resolve();
|
|
993
|
+
});
|
|
994
|
+
});
|
|
995
|
+
} else {
|
|
996
|
+
promise = Promise.resolve();
|
|
846
997
|
_tryFocus(getInitialFocusNode());
|
|
847
|
-
}
|
|
998
|
+
}
|
|
848
999
|
doc.addEventListener('focusin', checkFocusIn, true);
|
|
849
1000
|
doc.addEventListener('mousedown', checkPointerDown, {
|
|
850
1001
|
capture: true,
|
|
@@ -863,7 +1014,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
863
1014
|
passive: false
|
|
864
1015
|
});
|
|
865
1016
|
doc.addEventListener('keydown', checkEscapeKey);
|
|
866
|
-
return
|
|
1017
|
+
return promise;
|
|
867
1018
|
};
|
|
868
1019
|
|
|
869
1020
|
/**
|
|
@@ -877,7 +1028,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
877
1028
|
trap._setSubtreeIsolation(false);
|
|
878
1029
|
}
|
|
879
1030
|
state.adjacentElements.clear();
|
|
880
|
-
state.
|
|
1031
|
+
state.alreadySilent.clear();
|
|
881
1032
|
|
|
882
1033
|
// Collect all ancestors of all containers to avoid redundant processing.
|
|
883
1034
|
var containerAncestors = new Set();
|
|
@@ -1007,7 +1158,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1007
1158
|
var preexistingTrap = activeFocusTraps.getActiveTrap(trapStack);
|
|
1008
1159
|
var revertState = false;
|
|
1009
1160
|
if (preexistingTrap && !preexistingTrap.paused) {
|
|
1010
|
-
|
|
1161
|
+
var _preexistingTrap$_set;
|
|
1162
|
+
// [#1729] method MAY not exist if using `trapStack` option to share stack with older
|
|
1163
|
+
// versions of Focus-trap in the same DOM so use optional chaining here just in case
|
|
1164
|
+
// since this is a trap we may not have created from this instance of the library
|
|
1165
|
+
(_preexistingTrap$_set = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set === void 0 || _preexistingTrap$_set.call(preexistingTrap, false);
|
|
1011
1166
|
revertState = true;
|
|
1012
1167
|
}
|
|
1013
1168
|
try {
|
|
@@ -1018,17 +1173,35 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1018
1173
|
state.paused = false;
|
|
1019
1174
|
state.nodeFocusedBeforeActivation = _getActiveElement(doc);
|
|
1020
1175
|
onActivate === null || onActivate === void 0 || onActivate();
|
|
1021
|
-
var finishActivation = function
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1176
|
+
var finishActivation = /*#__PURE__*/function () {
|
|
1177
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
1178
|
+
return _regenerator().w(function (_context) {
|
|
1179
|
+
while (1) switch (_context.n) {
|
|
1180
|
+
case 0:
|
|
1181
|
+
if (checkCanFocusTrap) {
|
|
1182
|
+
updateTabbableNodes();
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// NOTE: wait for initial focus node to get focused before we potentially isolate
|
|
1186
|
+
// the subtrees with aria-hidden while focus is still in some other subtree and
|
|
1187
|
+
// not yet in the trap, resulting in some browsers (e.g. Chrome) logging to the
|
|
1188
|
+
// console that they, "Blocked aria-hidden on an element because its descendant
|
|
1189
|
+
// retained focus..."
|
|
1190
|
+
_context.n = 1;
|
|
1191
|
+
return addListeners();
|
|
1192
|
+
case 1:
|
|
1193
|
+
trap._setSubtreeIsolation(true);
|
|
1194
|
+
updateObservedNodes();
|
|
1195
|
+
onPostActivate === null || onPostActivate === void 0 || onPostActivate();
|
|
1196
|
+
case 2:
|
|
1197
|
+
return _context.a(2);
|
|
1198
|
+
}
|
|
1199
|
+
}, _callee);
|
|
1200
|
+
}));
|
|
1201
|
+
return function finishActivation() {
|
|
1202
|
+
return _ref6.apply(this, arguments);
|
|
1203
|
+
};
|
|
1204
|
+
}();
|
|
1032
1205
|
if (checkCanFocusTrap) {
|
|
1033
1206
|
checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);
|
|
1034
1207
|
return this;
|
|
@@ -1038,7 +1211,11 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1038
1211
|
// If our activation throws an exception and the stack hasn't changed,
|
|
1039
1212
|
// we need to re-enable the prior trap's subtree isolation.
|
|
1040
1213
|
if (preexistingTrap === activeFocusTraps.getActiveTrap(trapStack) && revertState) {
|
|
1041
|
-
|
|
1214
|
+
var _preexistingTrap$_set2;
|
|
1215
|
+
// [#1729] method MAY not exist if using `trapStack` option to share stack with older
|
|
1216
|
+
// versions of Focus-trap in the same DOM so use optional chaining here just in case
|
|
1217
|
+
// since this is a trap we may not have created from this instance of the library
|
|
1218
|
+
(_preexistingTrap$_set2 = preexistingTrap._setSubtreeIsolation) === null || _preexistingTrap$_set2 === void 0 || _preexistingTrap$_set2.call(preexistingTrap, true);
|
|
1042
1219
|
}
|
|
1043
1220
|
throw error;
|
|
1044
1221
|
}
|
|
@@ -1063,7 +1240,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1063
1240
|
if (!state.paused) {
|
|
1064
1241
|
trap._setSubtreeIsolation(false);
|
|
1065
1242
|
}
|
|
1066
|
-
state.
|
|
1243
|
+
state.alreadySilent.clear();
|
|
1067
1244
|
removeListeners();
|
|
1068
1245
|
state.active = false;
|
|
1069
1246
|
state.paused = false;
|
|
@@ -1116,7 +1293,7 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1116
1293
|
}
|
|
1117
1294
|
if (state.active) {
|
|
1118
1295
|
updateTabbableNodes();
|
|
1119
|
-
if (
|
|
1296
|
+
if (!state.paused) {
|
|
1120
1297
|
trap._setSubtreeIsolation(true);
|
|
1121
1298
|
}
|
|
1122
1299
|
}
|
|
@@ -1141,18 +1318,41 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1141
1318
|
var onPostPause = getOption(options, 'onPostPause');
|
|
1142
1319
|
onPause === null || onPause === void 0 || onPause();
|
|
1143
1320
|
removeListeners();
|
|
1144
|
-
updateObservedNodes();
|
|
1145
1321
|
trap._setSubtreeIsolation(false);
|
|
1322
|
+
updateObservedNodes();
|
|
1146
1323
|
onPostPause === null || onPostPause === void 0 || onPostPause();
|
|
1147
1324
|
} else {
|
|
1148
1325
|
var onUnpause = getOption(options, 'onUnpause');
|
|
1149
1326
|
var onPostUnpause = getOption(options, 'onPostUnpause');
|
|
1150
1327
|
onUnpause === null || onUnpause === void 0 || onUnpause();
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1328
|
+
var finishUnpause = /*#__PURE__*/function () {
|
|
1329
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
1330
|
+
return _regenerator().w(function (_context2) {
|
|
1331
|
+
while (1) switch (_context2.n) {
|
|
1332
|
+
case 0:
|
|
1333
|
+
updateTabbableNodes();
|
|
1334
|
+
|
|
1335
|
+
// NOTE: wait for initial focus node to get focused before we potentially isolate
|
|
1336
|
+
// the subtrees with aria-hidden while focus is still in some other subtree and
|
|
1337
|
+
// not yet in the trap, resulting in some browsers (e.g. Chrome) logging to the
|
|
1338
|
+
// console that they, "Blocked aria-hidden on an element because its descendant
|
|
1339
|
+
// retained focus..."
|
|
1340
|
+
_context2.n = 1;
|
|
1341
|
+
return addListeners();
|
|
1342
|
+
case 1:
|
|
1343
|
+
trap._setSubtreeIsolation(true);
|
|
1344
|
+
updateObservedNodes();
|
|
1345
|
+
onPostUnpause === null || onPostUnpause === void 0 || onPostUnpause();
|
|
1346
|
+
case 2:
|
|
1347
|
+
return _context2.a(2);
|
|
1348
|
+
}
|
|
1349
|
+
}, _callee2);
|
|
1350
|
+
}));
|
|
1351
|
+
return function finishUnpause() {
|
|
1352
|
+
return _ref7.apply(this, arguments);
|
|
1353
|
+
};
|
|
1354
|
+
}();
|
|
1355
|
+
finishUnpause();
|
|
1156
1356
|
}
|
|
1157
1357
|
return this;
|
|
1158
1358
|
}
|
|
@@ -1161,17 +1361,36 @@ var createFocusTrap = function createFocusTrap(elements, userOptions) {
|
|
|
1161
1361
|
value: function value(isEnabled) {
|
|
1162
1362
|
if (config.isolateSubtrees) {
|
|
1163
1363
|
state.adjacentElements.forEach(function (el) {
|
|
1364
|
+
var _el$getAttribute;
|
|
1164
1365
|
if (isEnabled) {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1366
|
+
switch (config.isolateSubtrees) {
|
|
1367
|
+
case 'aria-hidden':
|
|
1368
|
+
// check both attribute and property to ensure initial state is captured
|
|
1369
|
+
// correctly across different browsers and test environments (like JSDOM)
|
|
1370
|
+
if (el.ariaHidden === 'true' || ((_el$getAttribute = el.getAttribute('aria-hidden')) === null || _el$getAttribute === void 0 ? void 0 : _el$getAttribute.toLowerCase()) === 'true') {
|
|
1371
|
+
state.alreadySilent.add(el);
|
|
1372
|
+
}
|
|
1373
|
+
el.setAttribute('aria-hidden', 'true');
|
|
1374
|
+
break;
|
|
1375
|
+
default:
|
|
1376
|
+
// check both attribute and property to ensure initial state is captured
|
|
1377
|
+
// correctly across different browsers and test environments (like JSDOM)
|
|
1378
|
+
if (el.inert || el.hasAttribute('inert')) {
|
|
1379
|
+
state.alreadySilent.add(el);
|
|
1380
|
+
}
|
|
1381
|
+
el.setAttribute('inert', true);
|
|
1382
|
+
break;
|
|
1170
1383
|
}
|
|
1171
|
-
el.inert = true;
|
|
1172
1384
|
} else {
|
|
1173
|
-
if (state.
|
|
1174
|
-
|
|
1385
|
+
if (state.alreadySilent.has(el)) ; else {
|
|
1386
|
+
switch (config.isolateSubtrees) {
|
|
1387
|
+
case 'aria-hidden':
|
|
1388
|
+
el.removeAttribute('aria-hidden');
|
|
1389
|
+
break;
|
|
1390
|
+
default:
|
|
1391
|
+
el.removeAttribute('inert');
|
|
1392
|
+
break;
|
|
1393
|
+
}
|
|
1175
1394
|
}
|
|
1176
1395
|
}
|
|
1177
1396
|
});
|