react-focus-lock
Advanced tools
Comparing version 1.11.1 to 1.11.2
@@ -57,3 +57,3 @@ 'use strict'; | ||
if (persistentFocus || !focusOnBody() || !lastActiveFocus && autoFocus) { | ||
if (workingNode && !((0, _focusLock.focusInside)(workingNode) || focusIsPortaledPair(activeElement, workingNode))) { | ||
if (workingNode && !((0, _focusLock.focusInside)(workingNode) || focusIsPortaledPair(activeElement, workingNode) || workingNode.contains && workingNode.contains(activeElement))) { | ||
onActivation(); | ||
@@ -60,0 +60,0 @@ if (document && !lastActiveFocus && activeElement && !autoFocus) { |
{ | ||
"name": "react-focus-lock", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"description": "It is a trap! (for a focus)", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -13,3 +13,3 @@ import React from 'react'; | ||
import {Trap1, Trap2, Trap3, Trap4} from './Checkboxes'; | ||
import {TextSelectionEnabled, TextSelectionDisabled} from './TextSelection'; | ||
import {TextSelectionEnabled, TextSelectionDisabled, TextSelectionTabIndexEnabled} from './TextSelection'; | ||
import JumpCase from './Jump'; | ||
@@ -42,3 +42,4 @@ import GroupCase from './Group'; | ||
.add('enabled', () => <Frame><TextSelectionEnabled/></Frame>) | ||
.add('disabled', () => <Frame><TextSelectionDisabled/></Frame>); | ||
.add('disabled', () => <Frame><TextSelectionDisabled/></Frame>) | ||
.add('tabindex -1', () => <Frame><TextSelectionTabIndexEnabled/></Frame>); | ||
@@ -45,0 +46,0 @@ storiesOf('Jump', module) |
@@ -34,4 +34,6 @@ import React, {Component} from "react"; | ||
Some text | ||
{this.props.children} | ||
<input placeholder="input2"/> | ||
<input placeholder="input3"/> <br/> | ||
{ Array(100).fill(1).map(x => <div>{x}---</div>)} | ||
Some text | ||
@@ -66,6 +68,23 @@ <button>A BUTTON</button> | ||
const TextSelectionTabIndexEnabled = () => | ||
<div style={styles}> | ||
<input placeholder="input1"/> | ||
Some text | ||
<div style={bg}> | ||
<Trap allowTextSelection> | ||
<div tabIndex={-1}> | ||
test | ||
<input /> | ||
set | ||
</div> | ||
</Trap> | ||
</div> | ||
Some text | ||
<input placeholder="input1"/> | ||
</div>; | ||
export { | ||
TextSelectionEnabled, | ||
TextSelectionDisabled | ||
TextSelectionDisabled, | ||
TextSelectionTabIndexEnabled, | ||
} |
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
70869
1231