New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

makeup-keyboard-trap

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makeup-keyboard-trap

Restricts keyboard tabindex to a single subtree in the DOM

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
63
decreased by-56.25%
Maintainers
1
Weekly downloads
 
Created
Source

makeup-keyboard-trap

Build Status Coverage Status Dependency status devDependency status

A vanilla JavaScript port of jquery-keyboard-trap.

This module restricts keyboard tabindex to a single subtree in the DOM. This behaviour is useful when implementing a modal interface (e.g. a modal dialog).

It will ignore programmatically focusable items with a tabindex of -1.

Experimental

This module is still in an experimental state, until it reaches v1.0.0 you must consider all minor releases as breaking changes. Patch releases may introduce new features, but will be backwards compatible.

const keyboardTrap = require('makeup-keyboard-trap');

// trap an element
keyboardTrap.trap(document.querySelector('el'));

// untrap the current trapped element
keyboardTrap.untrap();

Install

// via npm
npm install makeup-keyboard-trap

// via yarn
yarn add makeup-keyboard-trap

Events

  • keyboardTrap : fired by trapped element when keyboard trap is activated
  • keyboardUntrap : fired by trapped element when keyboard trap is deactivated

Dependencies

  • None

Development

  • npm start
  • npm test
  • npm run lint
  • npm run fix
  • npm run build
  • npm run clean

The following hooks exist, and do not need to be invoked manually:

  • npm prepublish cleans, lints, tests and builds on every npm publish command
  • pre-commit cleans, lints, tests and builds on every git commit command

Test Reports

Each test run will generate the following reports:

  • /reports/coverage contains Istanbul code coverage report
  • /reports/html contains HTML test report

CI Build

https://travis-ci.org/makeup-js/makeup-keyboard-trap

Code Coverage

https://coveralls.io/github/makeup-js/makeup-keyboard-trap

Keywords

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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