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

roving-tabindex-element-list

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roving-tabindex-element-list

Library that keeps a list of Elements that can be navigated using tab

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Roving tabindex element list

Build Status npm version

JavaScript library that keeps a list of Elements that can be navigated using tab. This is very useful when working with accessibility.

Usage

import NavigationList from 'roving-tabindex-element-list';

const navigationList = new NavigationList(); 

navigationList.registerElement(element1);
navigationList.registerElement(element2);

// congratulations, you can now use arrow keys + HOME + END to move between the elements in the list 

Altering behaviour with plugins

const plugin = {
  init: (navigationList) => {
    navigationList.on('beforeUpdateState', ({ elements }) => {
      console.log('State is updating for list: ', elements);
    });
  }
}
  
const navigationList = new NavigationList({
  plugins: [plugin]
});

List of included plugins

  • Sort by dom position - Plugin that keeps the element list sorted based on element positions in the dom.
  • Prevent wrapping - Plugin that prevents the tabindex from wrapping around to the last element, when pressing up on the first element, and vise versa.

Licence

This librariy is licenced with the MIT Licence

Keywords

FAQs

Package last updated on 20 Nov 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