Update dependency focus-trap to v6 (develop) - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
focus-trap | dependencies | major | 5.1.0 -> 6.7.2 |
Release Notes
focus-trap/focus-trap
v6.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)
v6.7.1
Patch Changes
-
28a069f
: Fix bug from #504 where it's no longer possible to create a trap without any options [#525]
v6.7.0
Minor Changes
-
893dd2c
: Adddocument
option to support focus traps inside<iframe>
elements (#97) -
244f0c1
: Extend thesetReturnFocus
option to receive a reference to the element that had focus prior to the trap being activated when a function is specified. Additionally, the function can now returnfalse
to leave focus where it is at the time of deactivation. (#485)
Patch Changes
-
60162eb
: Fix bug whereKeyboardEvent
was not being passed toescapeDeactivates
option when it's a function (#498) -
7b6abfa
: Fix how focus-trap determines the event's target, which was preventing traps inside open shadow DOMs from working properly (#496) -
14b0ee8
: FixinitialFocus
option not supporting function returningfalse
as documented (#490)
v6.6.1
Patch Changes
-
24063d7
: Update tabbable to v5.2.1 to get bug fix for disabled fieldsets.
v6.6.0
Minor Changes
-
281e66c
: Add option to allow no initial focus when trap activates viainitialFocus: false
There may be cases where we don't want to focus the first tabbable element when a focus trap activates.
Examples use-cases:
- Modals/dialogs
- On mobile devices where "tabbing" doesn't make sense without a connected Bluetooth keyboard
In addition, this change ensures that any element inside the trap manually focused outside of
focus-trap
code will be brought back in focus if focus is somehow found outside of the trap.Example usage:
When the trap activates, there will be no initially focused element inside the new trap.
const focusTrap = createFocusTrap('#some-container', { initialFocus: false, });
-
75be463
:escapeDeactivates
can now be either a boolean (as before) or a function that takes an event and returns a boolean.
Patch Changes
-
e2294f0
: Fix race condition when activating a second trap where initial focus in the second trap may be thwarted because pausing of first trap clears thedelayInitialFocus
timer created for the second trap before during its activation sequence.
v6.5.1
Patch Changes
-
c38bf3f
: onPostDeactivate should always be called even if returnFocus/OnDeactivate is disabled.
v6.5.0
Minor Changes
-
278e77e
: Adding 4 new configuration event options to improve support for animated dialogs and animated focus trap triggers:checkCanFocusTrap()
,onPostActivate()
,checkCanReturnFocus()
, andonPostDeactivate()
.
Patch Changes
-
8d11e15
: Improve docs and types for most options, addingSVGElement
as a supported type of "DOM node" since it supports thefocus()
method, same asHTMLElement
.
v6.4.0
Minor Changes
-
21c82ce
: Bump tabbable from 5.1.6 to 5.2.0. There should be no changes in behavior as a result of this upgrade asfocus-trap
does not currently leverage the newdisplayCheck
option.
Patch Changes
-
1baf62e
: Fix focus trapped on initial focus container with tabindex=-1 when pressing shift+tab (#363)
v6.3.0
Minor Changes
-
a882d62
:clickOutsideDeactivates
can now also be a function that returns aboolean
, similar toallowOutsideClick
. The function receives theMouseEvent
that triggered the click. (#289)
Patch Changes
-
4d67dee
: Fix a focus escape when pressing TAB after hiding element with focus (#281) -
ca32014
: Bump tabbable from 5.1.4 to 5.1.5
v6.2.3
Patch Changes
v6.2.2
Patch Changes
-
fd3f2d1
: Fix a bug where a multi-container trap would cease to work if all tabbable nodes were removed from one of the containers (fixes #223). As a result, an error is now thrown if the trap is left in a state where none of its containers contain any tabbable nodes (unless afallbackFocus
node has been configured in the trap's options). Also, the most-recently-focused node is more reliably tracked now, should focus somehow escape the trap and be brought back in by the trap, resulting in the truly most-recently-focused node to regain focus if that ever happens.
v6.2.1
Patch Changes
-
f0c2aff
: Bump tabbable to 5.1.4 for bug fix. -
2ba512b
:- Refactored code to use function declarations instead of hoisted functions (this should have no bearing on functionality in the build output included in
./dist
. - Fixed bugs where
trap.activate()
andtrap.deactivate()
would not always return the trap (now they do in all circumstances).
- Refactored code to use function declarations instead of hoisted functions (this should have no bearing on functionality in the build output included in
-
d26d2e1
: Refactoring to use const/let, and simplify a few lines. This does NOT impact the build output published in./dist
, however, and hence does not impact browser support.
v6.2.0
Minor Changes
v6.1.4
Patch Changes
v6.1.3
Patch Changes
-
6a39217
: Close the gap with #172 and bumptabbable
to 5.1.2 which has a similar fix. -
756c79d
: Fix #172 (again): Transpile ESM bundle down to the same browser target used for the CJS and UMD bundles. ESM is just the module system, not the browser target.
v6.1.2
Patch Changes
-
00674dd
: Fix #172: Transpile non-minified bundles so they are compatible with IE11. -
679009b
: Update tabbable dependency to 5.1.1 to get transpiled non-minified bundles.
v6.1.1
Patch Changes
-
fe2b0ad
: Fixed #103:returnFocusOnDeactivate
is now respected on auto-deactivation withclickOutsideDeactivates=true
.
v6.1.0
Minor Changes
-
5174ce1
: Add delayInitialFocus option
Patch Changes
-
53b906b
: ChangeprepublishOnly
script toprepare
script so that it also runs if someone installs the package directly from the git repo (e.g. from your work in which you fixed a bug or added a feature you're waiting to get merged to master and published to NPM). -
31bb28e
: Update tabbable dependency to 5.1.0. The most significant update for focus-trap is a bug fix related to fixed-position containers.
v6.0.1
Patch Changes
-
694e2fa
: Package main/module entries no longer point to minified bundles.
v6.0.0
- Add boolean value support for
allowOutsideClick
option. - New
preventScroll
feature to prevent scrolling to the element getting focus if not in the viewport. - Changed code formatting to use dangling commas where ES5 supports them.
-
BREAKING: Updated tabbable dependency to the new 5.0.0 release which contains breaking changes to its
isTabbableRadio()
internal function. - Help with tree shaking by having
package.json
statesideEffects: false
to mark this module as having no side effects as a result of merely importing it. -
BREAKING: This
package.json
's "main" no longer points to./index.js
in the package (although it still points to a CJS module, so it's possible this actually doesn't break anything). It now has:- "main":
dist/focus-trap.min.js
(the CJS bundle) - "module":
dist/focus-trap.esm.min.js
(the new ESM bundle) - the UMD is
dist/focus-trap.umd.min.js
if needed (convenient for loading directly in an older browser that doesn't support ESM) -
NOTE: The CJS build no longer provides a function as a default export. Use
const { createFocusTrap } = require('focus-trap');
to get the function from before. -
NOTE: The ESM build does not provide a default export. Use
import { createFocusTrap } from 'focus-trap';
to import the module.
- "main":
-
New ESM Build: Included in
dist/focus-trap.esm.*
. - New UMD Build: Included in
dist/focus-trap.umd.*
.
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.