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

@rb/capture-tab-navigation

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rb/capture-tab-navigation

Utility function for capturing tab navigation inside an HTMLElement

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

capture-tab-navigation

Utility function to capture tab navigation inside an HTMLElement.

When hitting tab when the last element is focused, it cycles to the first focusable element inside the container.

When hitting shift+tab when the first element inside the container is focused, it cycles to the last focusable element inside the container.

Install

$ npm i --save @rb/capture-tab-navigation

Usage

import captureTabNavigation from '@rb/capture-tab-navigation'

// the HTMLElement where you want to capture tav navigation
const myDialog = document.querySelector('...')

myDialog.addEventListener('keydown', function(event) {
  // the function expects the container HTMLElement
  // and the keydown event object
  captureTabNavigation(myDialog, event)
})

License

MIT

Keywords

FAQs

Package last updated on 17 Jul 2017

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