Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

focus-trap

Package Overview
Dependencies
Maintainers
0
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-trap - npm Package Versions

1
9

6.1.0

Diff

Changelog

Source

6.1.0

Minor Changes

  • 5174ce1: Add delayInitialFocus option

Patch Changes

  • 53b906b: Change 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).
  • 31bb28e: Update tabbable dependency to 5.1.0. The most significant update for focus-trap is a bug fix related to fixed-position containers.
stefcameron
published 6.0.1 •

Changelog

Source

6.0.1

Patch Changes

  • 694e2fa: Package main/module entries no longer point to minified bundles.
stefcameron
published 6.0.0 •

Changelog

Source

6.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 state sideEffects: 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.
  • New ESM Build: Included in dist/focus-trap.esm.*.
  • New UMD Build: Included in dist/focus-trap.umd.*.
davidtheclark
published 5.1.0 •

Changelog

Source

5.1.0

  • Add setReturnFocus option that allows you to set which element receives focus when the trap closes.
davidtheclark
published 5.0.2 •

Changelog

Source

5.0.2

  • Add allowOutsideClick option that allows you to pass a click event through, even when clickOutsideDeactivates is false.
davidtheclark
published 5.0.1 •

davidtheclark
published 5.0.0 •

Changelog

Source

5.0.0

  • Update Tabbable to improve performance (see Tabbable's changelog).
  • Breaking (kind of): if the onActivate callback changes the list of tabbable nodes and the initialFocus option is not used, the initial focus will still go to the first element present before the callback.
  • Improve performance of activating a trap.
  • Register document-level event listeners as active (passive: false).
davidtheclark
published 4.0.2 •

Changelog

Source

4.0.2

  • Fix reference to root element that caused errors within Shadow DOM.

(Release 4.0.1 was a mistake, containing no changes.)

davidtheclark
published 4.0.1 •

davidtheclark
published 4.0.0 •

Changelog

Source

4.0.0

  • Breaking (kind of): Focus trap now manages a queue of traps, so when a trap is paused because another trap activates, it will be unpaused when that other trap deactivates. If Trap A was automatically paused because Trap B activated (existing behavior), when Trap B is deactivated Trap A will be automatically unpaused (new behavior).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc