Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: theKashey/react-focus-lock
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 216edb69f61363ea6256fc573a23a521c4528b85
Choose a base ref
...
head repository: theKashey/react-focus-lock
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 487cba8a3a1a9a9100f34c611726385c5439633b
Choose a head ref
  • 4 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 22, 2018

  1. Fix Jest support

    ai authored Feb 22, 2018
    Copy the full SHA
    44d3895 View commit details
  2. Merge pull request #22 from ai/patch-1

    Fix Jest support
    theKashey authored Feb 22, 2018
    Copy the full SHA
    e4927cb View commit details
  3. Unfix prop-types version, #21

    This should be a bit more flexible.
    theKashey authored Feb 22, 2018
    Copy the full SHA
    a433db9 View commit details
  4. 1.6.6

    theKashey committed Feb 22, 2018
    Copy the full SHA
    487cba8 View commit details
Showing with 3 additions and 3 deletions.
  1. +2 βˆ’2 package.json
  2. +1 βˆ’1 src/Trap.js
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-focus-lock",
"version": "1.6.5",
"version": "1.6.6",
"description": "It is a trap! (for a focus)",
"main": "dist/index.js",
"types": "react-focus-lock.d.ts",
@@ -69,7 +69,7 @@
"homepage": "https://github.com/theKashey/react-focus-lock#readme",
"dependencies": {
"focus-lock": "^0.1.0",
"prop-types": "15.5.10",
"prop-types": "^15.5.10",
"react-side-effect": "^1.1.3"
}
}
2 changes: 1 addition & 1 deletion src/Trap.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import withSideEffect from 'react-side-effect';
import moveFocusInside, { focusInside } from 'focus-lock';
import { deferAction } from './util';

const focusOnBody = () => document.activeElement !== document.body;
const focusOnBody = () => document && document.activeElement !== document.body;

let lastActiveTrap = 0;
let lastActiveFocus = null;