Releases: DaviDevMod/focus-trap
@davidevmod/[email protected]
Patch Changes
-
173b47bThanks @DaviDevMod! - Fix name UMD module in package.json -
3f01c26Thanks @DaviDevMod! - SwitchisBuilttotrueonly after gettinginitialFocusIf
getInitialFocusfails, no trap is built.
@davidevmod/[email protected]
Major Changes
c1c9aa3Thanks @DaviDevMod! - Move "true-myth" from "devDependencies" to "dependencies" and remove it from the bundle
@davidevmod/[email protected]
Patch Changes
-
4f90a03Thanks @DaviDevMod! - Fix handling ofTabfrom elements with a positive tab index. -
0cfe93fThanks @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
-
d6d2eccThanks @DaviDevMod! - Remove possibility to preovidelockas a function. -
95eb8a4Thanks @DaviDevMod! - Return just a shallow copy of theNormalisedTrapConfig.
@davidevmod/[email protected]
Major Changes
-
bcb45dfThanks @DaviDevMod! - Remove exceptions.ts and throw errors even in production. -
f70f79bThanks @DaviDevMod! - AddisBuiltto the return value.
Patch Changes
-
3eae44cThanks @DaviDevMod! - Improve type oflocK.From a broad
boolean | Functiontype to a stricterboolean | ((event: KeyboardEvent) => void).
@davidevmod/[email protected]
Major Changes
c4c8696Thanks @DaviDevMod! - Bump to v1.0
Patch Changes
-
2c17880Thanks @DaviDevMod! - Remove possibility to provideescapeas a function.It is unnecessary, as the user of the library can easily listen for
Esckey presses by themselves.As a side note, the implementation of the previous behaviour was buggy.
-
d95f7dfThanks @DaviDevMod! - Fix logic to "normalise"returnFocusin normalise.tsThe default
document.activeElementwas not given in casereturnFocuswasundefinedor a string not corresponding to any ID in the DOM.
It was given only whenreturnFocus === true. -
fd6cf73Thanks @DaviDevMod! - Fix algorithm to find a destination for the focus.When (during in the context of a Tab key press happening)
event.targethas a tab index of zero, the library should switch from looking for the next zero tabbable to look for a positive tabbable wheneverevent.targetis 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.targetwas contained in or preceded/followed the first/last root in the focus-trap. -
2c5bd1cThanks @DaviDevMod! - Remove custom type annotation forArray.prototype.findLast.It is now buit-in since TypeScript v5.0 (microsoft/TypeScript#48829 (comment)).
-
0d154e8Thanks @DaviDevMod! - Fixdemolishlogic in trap-actions.tsstate.isBuiltwas set tofalsebefore callingpauseand the focus trap was therefore left up and running (while an error would be thrown, saying "Cannot pause inexistent trap" ). -
0d90cbaThanks @DaviDevMod! - Export types -
79b0e44Thanks @DaviDevMod! - Fix inefficient code in destination.ts