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

focus-trap

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-trap - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

10

CHANGELOG.md

@@ -1,7 +0,13 @@

# 1.0.1
# Changelog
## 1.0.2
- Make sure to `select()` `<input>` elements when they receive focus via tab.
## 1.0.1
- Fix buggy attempts to focus nodes that don't exist.
# 1.0.0
## 1.0.0
- Initial release.

6

index.js

@@ -114,3 +114,7 @@ var tabbable = require('tabbable');

function tryFocus(node) {
if (node && node.focus) node.focus();
if (!node || !node.focus) return;
node.focus();
if (node.tagName.toLowerCase() === 'input') {
node.select();
}
}

@@ -117,0 +121,0 @@

{
"name": "focus-trap",
"version": "1.0.1",
"version": "1.0.2",
"description": "Trap focus within a DOM node.",

@@ -9,5 +9,4 @@ "main": "index.js",

"demo-bundle": "browserify demo/js/index.js -o demo/demo-bundle.js",
"demo-watch": "watchify demo/js/index.js -d -o demo/demo-bundle.js",
"demo-bs": "browser-sync start --server demo --files=\"demo/**/*.css,demo/index.html,demo/demo-bundle.js\"",
"demo-dev": "parallelshell \"npm run demo-watch\" \"npm run demo-bs\"",
"demo-watch": "watchify demo/js/index.js -d -v -o demo/demo-bundle.js",
"demo-dev": "npm run demo-watch & http-server demo",
"test": "npm run lint"

@@ -37,7 +36,6 @@ },

"devDependencies": {
"browser-sync": "2.8.2",
"browserify": "11.0.1",
"eslint": "1.2.1",
"parallelshell": "2.0.0",
"watchify": "3.3.1"
"browserify": "13.0.0",
"eslint": "1.10.3",
"http-server": "0.8.5",
"watchify": "3.7.0"
},

@@ -44,0 +42,0 @@ "files": [

@@ -11,2 +11,4 @@ # focus-trap

If you are using React, check out [focus-trap-react](https://github.com/davidtheclark/focus-trap-react), a light wrapper around this library. If you are not a React user, consider creating light wrappers in your framework-of-choice!
## What it does

@@ -13,0 +15,0 @@

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