Skip to content

Releases: DaviDevMod/focus-trap

@davidevmod/[email protected]

14 Jun 02:22
bba53e0
Compare
Choose a tag to compare

Patch Changes

  • 173b47b Thanks @DaviDevMod! - Fix name UMD module in package.json

  • 3f01c26 Thanks @DaviDevMod! - Switch isBuilt to true only after getting initialFocus

    If getInitialFocus fails, no trap is built.

@davidevmod/[email protected]

09 Jun 23:03
047a208
Compare
Choose a tag to compare

Major Changes

  • c1c9aa3 Thanks @DaviDevMod! - Move "true-myth" from "devDependencies" to "dependencies" and remove it from the bundle

@davidevmod/[email protected]

02 Jun 21:52
6591cc1
Compare
Choose a tag to compare

Patch Changes

  • 4f90a03 Thanks @DaviDevMod! - Fix handling of Tab 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]

31 May 19:57
e457de8
Compare
Choose a tag to compare

Major Changes

@davidevmod/[email protected]

30 May 01:17
3c51d4b
Compare
Choose a tag to compare

Major Changes

Patch Changes

  • 3eae44c Thanks @DaviDevMod! - Improve type of locK.

    From a broad boolean | Function type to a stricter boolean | ((event: KeyboardEvent) => void).

@davidevmod/[email protected]

26 May 15:51
9d1800a
Compare
Choose a tag to compare

Major Changes

Patch Changes

  • 2c17880 Thanks @DaviDevMod! - Remove possibility to provide escape 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.ts

    The default document.activeElement was not given in case returnFocus was undefined or a string not corresponding to any ID in the DOM.
    It was given only when returnFocus === 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 whenever event.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 for Array.prototype.findLast.

    It is now buit-in since TypeScript v5.0 (microsoft/TypeScript#48829 (comment)).

  • 0d154e8 Thanks @DaviDevMod! - Fix demolish logic in trap-actions.ts

    state.isBuilt was set to false before calling pause 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