Releases: DaviDevMod/focus-trap
@davidevmod/[email protected]
Patch Changes
-
173b47b
Thanks @DaviDevMod! - Fix name UMD module in package.json -
3f01c26
Thanks @DaviDevMod! - SwitchisBuilt
totrue
only after gettinginitialFocus
If
getInitialFocus
fails, no trap is built.
@davidevmod/[email protected]
Major Changes
c1c9aa3
Thanks @DaviDevMod! - Move "true-myth" from "devDependencies" to "dependencies" and remove it from the bundle
@davidevmod/[email protected]
Patch Changes
-
4f90a03
Thanks @DaviDevMod! - Fix handling ofTab
from elements with a positive tab index. -
0cfe93f
Thanks @DaviDevMod! - Fix algorithm to find the next tabbable element with a positive tab index.It was missing to check whether the element was actually focusable.
@davidevmod/[email protected]
Major Changes
-
d6d2ecc
Thanks @DaviDevMod! - Remove possibility to preovidelock
as a function. -
95eb8a4
Thanks @DaviDevMod! - Return just a shallow copy of theNormalisedTrapConfig
.
@davidevmod/[email protected]
Major Changes
-
bcb45df
Thanks @DaviDevMod! - Remove exceptions.ts and throw errors even in production. -
f70f79b
Thanks @DaviDevMod! - AddisBuilt
to the return value.
Patch Changes
-
3eae44c
Thanks @DaviDevMod! - Improve type oflocK
.From a broad
boolean | Function
type to a stricterboolean | ((event: KeyboardEvent) => void)
.
@davidevmod/[email protected]
Major Changes
c4c8696
Thanks @DaviDevMod! - Bump to v1.0
Patch Changes
-
2c17880
Thanks @DaviDevMod! - Remove possibility to provideescape
as a function.It is unnecessary, as the user of the library can easily listen for
Esc
key presses by themselves.As a side note, the implementation of the previous behaviour was buggy.
-
d95f7df
Thanks @DaviDevMod! - Fix logic to "normalise"returnFocus
in normalise.tsThe default
document.activeElement
was not given in casereturnFocus
wasundefined
or a string not corresponding to any ID in the DOM.
It was given only whenreturnFocus === true
. -
fd6cf73
Thanks @DaviDevMod! - Fix algorithm to find a destination for the focus.When (during in the context of a Tab key press happening)
event.target
has a tab index of zero, the library should switch from looking for the next zero tabbable to look for a positive tabbable wheneverevent.target
is or precedes/follows the first/last zero tabbable in the whole focus trap.Before the fix, the switch in search would have happened only if
event.target
was contained in or preceded/followed the first/last root in the focus-trap. -
2c5bd1c
Thanks @DaviDevMod! - Remove custom type annotation forArray.prototype.findLast
.It is now buit-in since TypeScript v5.0 (microsoft/TypeScript#48829 (comment)).
-
0d154e8
Thanks @DaviDevMod! - Fixdemolish
logic in trap-actions.tsstate.isBuilt
was set tofalse
before callingpause
and the focus trap was therefore left up and running (while an error would be thrown, saying "Cannot pause inexistent trap" ). -
0d90cba
Thanks @DaviDevMod! - Export types -
79b0e44
Thanks @DaviDevMod! - Fix inefficient code in destination.ts