# Changelog ## 7.6.2 ### Patch Changes - d4a4c34: Replace findIndex with native implementation - [Closes #1305](https://github.com/focus-trap/focus-trap/issues/1305 ## 7.6.1 ### Patch Changes - fc5910d: Fix fallbackFocus not used when initialFocus is selector to non-existent node ([#1218](https://github.com/focus-trap/focus-trap/issues/1218)) ## 7.6.0 ### Minor Changes - 8aeacee: Move `Escape` key handler to target phase to allow more control in `escapeDeactivates` ([#1247](https://github.com/focus-trap/focus-trap/issues/1247)) ## 7.5.4 ### Patch Changes - 680f6e8: Fix issue with not being able to cycle back to the start from the last element if there is a focusable web component inside the focus-trap ((#1068)[https://github.com/focus-trap/focus-trap/issues/1068]) ## 7.5.3 ### Patch Changes - 203b322: Fix missing typings for initialFocus option ([#1060](https://github.com/focus-trap/focus-trap/issues/1060)) ## 7.5.2 ### Patch Changes - b73eb02: Remove references to `Array.prototype.findLast()` not well supported in Safari ([#996](https://github.com/focus-trap/focus-trap/issues/996)) ## 7.5.1 ### Patch Changes - d9e2546: Fix possible exception in new `Tabbable.getTabIndex()` when initializing trap ## 7.5.0 ### Minor Changes - 5e2f913: Adds support for nodes with a positive tabindex in single-container traps only ([#375](https://github.com/focus-trap/focus-trap/issues/375)) ## 7.4.3 ### Patch Changes - 134678b: Ensure focus is kept inside the trap when focused element is removed from the DOM ([focus-trap/focus-trap-react#962](https://github.com/focus-trap/focus-trap-react/issues/962)) ## 7.4.2 ### Patch Changes - db62ce3: Clicking on open shadowDOM components within a focus trap's container when `clickOutsideDeactivates=true` should not deactivate the focus trap. ([#959](https://github.com/focus-trap/focus-trap/issues/959)) ## 7.4.1 ### Patch Changes - 4f720ff: Bump tabbable to v6.1.2 for nwsapi patch ## 7.4.0 ### Minor Changes - da97007: Added new onPost/Pause and onPost/Unpause hooks when un/pausing a trap (also called when auto-un/paused as a result of de/activating a second trap while another is currently active). ([focus-trap-react#948](https://github.com/focus-trap/focus-trap-react/issues/948)) ## 7.3.1 ### Patch Changes - a00cfa5: Bump tabbable to v6.1.1 for JSDom fixes ## 7.3.0 ### Minor Changes - ae7129d: Bump tabbable to v6.1.0 adding support for the new HTML `inert` attribute in browsers that support it (NOTE: FireFox does not support it at this time). Also fixes a bug. See tabbable CHANGELOG for more info. ### Patch Changes - a27ad58: Fix incorrect behavior of `returnFocusOnDeactivate` option when set to true (or defaulted to true) along with `clickOutsideDeactivates=true` and the outside click that deactivates is on a focusable node. Focus was remaining on that node instead of returning to the node focused just prior to activation. ([#893](https://github.com/focus-trap/focus-trap/issues/893)) ## 7.2.0 ### Minor Changes - b0482af: Add new `isKeyForward()` and `isKeyBackward()` options ([#612](https://github.com/focus-trap/focus-trap/issues/612)) ## 7.1.0 ### Minor Changes - 88cc9bc: Provide new `trapStack` option to make it possible to coordinate auto-activation/pausing between multiple `focus-trap` instances on the same page. ### Patch Changes - 4f97b38: Bump tabbable to v6.0.1 for a bug fix. See tabbable's changelog for more details. - f13de76: Mention special Safari setting to enable normal DOM-based tab order in README. [#783](https://github.com/focus-trap/focus-trap/issues/783) ## 7.0.0 ### Major Changes - 5b64423: Revised and clarified official browser support (still as broad and deep as _reasonably_ possible). - 47f62ac: 🚨 **Breaking:** Tabbable dependency has been updated to v6.0.0 and contains a breaking change related to detached nodes with its default `displayCheck` setting. See tabbable's [changelog](https://github.com/focus-trap/tabbable/blob/master/CHANGELOG.md#600) for more information. - 5b64423: 🚨 **Breaking:** Dropped support of IE browsers, all versions. - IE11 was [officially retired](https://blogs.windows.com/windowsexperience/2022/06/15/internet-explorer-11-has-retired-and-is-officially-out-of-support-what-you-need-to-know/) on June 15, 2022 (6 weeks ago). There are no longer any versions of IE that are still maintained or even supported by Microsoft. ## 6.9.4 ### Patch Changes - f68882e: Fix docs and typings to clarify that initialFocus, fallbackFocus, and setReturnFocus options can be functions that also return selector strings. ## 6.9.3 ### Patch Changes - 8a8b1f1: Bump tabbable to v5.3.3 to pick up a small bug fix to web component (shadow DOM) support. ## 6.9.2 ### Patch Changes - ef0ce48: Handle unexpected param (true) passed as the value for the `initialFocus`, `fallbackFocus`, and `setReturnFocus` options: Ignore and perform default behavior. ## 6.9.1 ### Patch Changes - 83262a7: Bumps tabbable to v5.3.2 to pick-up a fix to `displayCheck=full` (default) option behavior that caused issues with detached nodes. ## 6.9.0 ### Minor Changes - 2a57e4b: Add new `trap.active` and `trap.paused` readonly state properties on the trap so that the trap's active/paused state can be queried. ### Patch Changes - 8fd49df: Fixed bug where `clickOutsideDeactivate` handler would get called on the 'click' event even if the node clicked was in the trap. As with 'mousedown' and 'touchstart' events where this option is also used, the handler should only get called if the target node is _outside_ the trap. - c32c60a: Fixed: onDeactivate, onPostDeactivate, and checkCanReturnFocus options originally given to createFocusTrap() were not being used by default when calling `trap.deactivate({...})` with an option set even if that option set didn't specify any overrides of these options. ## 6.8.1 ### Patch Changes - 7c86111: - Bump tabbable to `^5.3.1` (fixing previous update which was incorrectly set to `5.3.0`). - Fix `tabbableOptions` not being used in all internal uses of tabbable APIs. - Expose `displayCheck` option in `tabbableOptions` typings and pass it through to tabbable APIs. - Add info to README about testing traps in JSDom (which is not officially supported). ## 6.8.0 ### Minor Changes - 21458c9: Bumps tabbable to v5.3.0 and includes all changes from the past v6.8.0 beta releases. The big new feature is opt-in Shadow DOM support in tabbable, and a new `getShadowRoot` tabbable option exposed in a new `tabbableOptions` focus-trap config option. - ⚠️ This will likely break your tests **if you're using JSDom** (e.g. with Jest). See [testing in JSDom](./README.md#testing-in-jsdom) for more info. ## 6.8.0-beta.2 - When updating tabbable nodes, make sure that `getShadowRoot` tabbable option is also passed to `focusable()`. - Fix bug where having a tabbable node inside a web component in the middle of a tab sequence would cause the tab key to seemingly stop working just before focus should move to it ((#643)[https://github.com/focus-trap/focus-trap/issues/643]). - Bumps tabbable to `v5.3.0-beta.1` ## 6.8.0-beta.1 - Previous beta didn't include new source. This one does. ## 6.8.0-beta.0 - Adds new `tabbableOptions` configuration option, which allows specifically for the new `getShadowRoot` Tabbable configuration option: `focusTrap.createFocusTrap(rootElement, { tabbableOptions: { getShadowRoot: (node) => closedShadowRoot } })`, for example (where your code has the reference to `closedShadowRoot` previously created on `node` which Tabbable cannot find on its own). - Bumps tabbable to `v5.3.0-beta.0` ## 6.7.3 ### Patch Changes - ab20d3d: Fix issue with focusing negative tabindex node and then tabbing away when this node is _not_ the last node in the trap's container ((#611)[https://github.com/focus-trap/focus-trap/issues/611]) ## 6.7.2 ### Patch Changes - c932330: Fixed bug where tabbing forward from an element with negative tabindex that is last in the trap would result in focus remaining on that element ([565](https://github.com/focus-trap/focus-trap/issues/565)) ## 6.7.1 ### Patch Changes - 28a069f: Fix bug from #504 where it's no longer possible to create a trap without any options [#525] ## 6.7.0 ### Minor Changes - 893dd2c: Add `document` option to support focus traps inside `