focus-trap
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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. |
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9230
4
103
99