focus-trap
Advanced tools
Changelog
6.2.1
./dist
.trap.activate()
and trap.deactivate()
would not always return the trap (now they do in all circumstances)../dist
, however, and hence does not impact browser support.Changelog
6.2.0
Changelog
6.1.3
tabbable
to 5.1.2 which has a similar fix.Changelog
6.1.2
Changelog
6.1.1
returnFocusOnDeactivate
is now respected on auto-deactivation with clickOutsideDeactivates=true
.Changelog
6.1.0
prepublishOnly
script to prepare
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).Changelog
6.0.1
Changelog
6.0.0
allowOutsideClick
option.preventScroll
feature to prevent scrolling to the element getting focus if not in the viewport.isTabbableRadio()
internal function.package.json
state sideEffects: false
to mark this module as having no side effects as a result of merely importing it.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:
dist/focus-trap.min.js
(the CJS bundle)dist/focus-trap.esm.min.js
(the new ESM bundle)dist/focus-trap.umd.min.js
if needed (convenient for loading directly in an older browser that doesn't support ESM)const { createFocusTrap } = require('focus-trap');
to get the function from before.import { createFocusTrap } from 'focus-trap';
to import the module.dist/focus-trap.esm.*
.dist/focus-trap.umd.*
.Changelog
5.1.0
setReturnFocus
option that allows you to set which element receives focus when the trap closes.