focus-lock
Advanced tools
Comparing version 0.6.3 to 0.6.4
{ | ||
"name": "focus-lock", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "DOM trap for a focus", | ||
@@ -8,2 +8,3 @@ "main": "dist/cjs/index.js", | ||
"module": "dist/es2015/index.js", | ||
"sideEffects": false, | ||
"scripts": { | ||
@@ -30,2 +31,6 @@ "build:cjs": "NODE_ENV=cjs babel src -d dist/cjs", | ||
], | ||
"files": [ | ||
"dist", | ||
"constants" | ||
], | ||
"author": "theKashey <thekashey@gmail.com>", | ||
@@ -32,0 +37,0 @@ "license": "MIT", |
@@ -6,3 +6,13 @@ # focus-lock | ||
This is quite low level API, to be used by final realization. Usually everything | ||
# Consumers | ||
This is a base package for: | ||
- [react-focus-lock](https://github.com/theKashey/react-focus-lock) | ||
[![downloads](https://badgen.net/npm/dm/react-focus-lock)](https://www.npmtrends.com/react-focus-lock) | ||
- [vue-focus-lock](https://github.com/theKashey/vue-focus-lock) | ||
[![downloads](https://badgen.net/npm/dm/vue-focus-lock)](https://www.npmtrends.com/vue-focus-lock) | ||
- [dom-focus-lock](https://github.com/theKashey/dom-focus-lock) | ||
[![downloads](https://badgen.net/npm/dm/dom-focus-lock)](https://www.npmtrends.com/dom-focus-lock) | ||
Provides a low level API, to be used by final realization. Usually everything | ||
can be solved in 3 lines | ||
@@ -12,4 +22,4 @@ ```js | ||
if (observed && !focusInside(observed)) { | ||
result = moveFocusInside(observed, lastActiveFocus); | ||
if (topNode && !focusInside(topNode)) { | ||
moveFocusInside(topNode, lastActiveFocus); | ||
} | ||
@@ -27,14 +37,2 @@ ``` | ||
# Implementations | ||
This is vanilla js base package for: | ||
- [react-focus-lock](https://github.com/theKashey/react-focus-lock) | ||
- [vue-focus-lock](https://github.com/theKashey/vue-focus-lock) | ||
- [dom-focus-lock](https://github.com/theKashey/dom-focus-lock) | ||
This is a small, but very useful for: | ||
- Modal dialogs. You can not leave it with "Tab", ie tab-out. | ||
- Focused tasks. It will aways brings you back. | ||
# Focus fighting | ||
@@ -41,0 +39,0 @@ It is possible, that more that one "focus management system" is present on the site. |
40530
33
58