Socket
Socket
Sign inDemoInstall

focus-trap-react

Package Overview
Dependencies
Maintainers
5
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

focus-trap-react - npm Package Compare versions

Comparing version 8.7.1 to 8.8.0

7

CHANGELOG.md
# Changelog
## 8.8.0
### Minor Changes
- c8e46c2: Support new `document` option introduced in focus-trap v6.7.0 (#460)
- 5ee587c: Bump focus-trap dependency to v6.7.1
## 8.7.1

@@ -4,0 +11,0 @@

9

dist/focus-trap-react.js

@@ -17,3 +17,3 @@ "use strict";

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

@@ -133,4 +133,6 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

value: function updatePreviousElement() {
if (typeof document !== 'undefined') {
this.previouslyFocusedElement = document.activeElement;
var currentDocument = this.props.focusTrapOptions.document || document;
if (currentDocument) {
this.previouslyFocusedElement = currentDocument.activeElement;
}

@@ -288,2 +290,3 @@ }

focusTrapOptions: PropTypes.shape({
document: PropTypes.object,
onActivate: PropTypes.func,

@@ -290,0 +293,0 @@ onPostActivate: PropTypes.func,

{
"name": "focus-trap-react",
"version": "8.7.1",
"version": "8.8.0",
"description": "A React component that traps focus.",

@@ -58,12 +58,12 @@ "main": "dist/focus-trap-react.js",

"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
"@babel/cli": "^7.15.7",
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/preset-env": "^7.15.0",
"@babel/preset-env": "^7.15.6",
"@babel/preset-react": "^7.14.5",
"@changesets/cli": "^2.16.0",
"@testing-library/cypress": "^8.0.0",
"@testing-library/dom": "^8.1.0",
"@changesets/cli": "^2.17.0",
"@testing-library/cypress": "^8.0.1",
"@testing-library/dom": "^8.5.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react": "^12.1.0",
"@testing-library/user-event": "^13.2.1",

@@ -73,16 +73,16 @@ "@types/jquery": "^3.5.6",

"babel-eslint": "^10.1.0",
"babel-jest": "^27.0.6",
"babel-jest": "^27.2.1",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
"budo": "^11.6.4",
"cypress": "^8.2.0",
"cypress": "^8.4.1",
"cypress-plugin-tab": "^1.0.5",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-react": "^7.24.0",
"jest": "^27.0.6",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-react": "^7.26.0",
"jest": "^27.2.1",
"jest-watch-typeahead": "^0.6.4",
"onchange": "^7.1.0",
"prettier": "^2.3.2",
"prettier": "^2.4.1",
"prop-types": "^15.7.2",

@@ -92,7 +92,7 @@ "react": "^17.0.2",

"regenerator-runtime": "^0.13.9",
"start-server-and-test": "^1.13.1",
"typescript": "^4.3.5"
"start-server-and-test": "^1.14.0",
"typescript": "^4.4.3"
},
"dependencies": {
"focus-trap": "^6.6.1"
"focus-trap": "^6.7.1"
},

@@ -99,0 +99,0 @@ "peerDependencies": {

# focus-trap-react [![CI](https://github.com/focus-trap/focus-trap-react/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/focus-trap/focus-trap-react/actions?query=workflow:CI+branch:master) [![Codecov](https://img.shields.io/codecov/c/github/focus-trap/focus-trap-react)](https://codecov.io/gh/focus-trap/focus-trap-react) [![license](https://badgen.now.sh/badge/license/MIT)](./LICENSE)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

@@ -206,2 +206,3 @@

<td align="center"><a href="http://tylerhawkins.info/201R/"><img src="https://avatars0.githubusercontent.com/u/13806458?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tyler Hawkins</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap-react/commits?author=thawkin3" title="Documentation">📖</a> <a href="#example-thawkin3" title="Examples">💡</a> <a href="https://github.com/focus-trap/focus-trap-react/commits?author=thawkin3" title="Tests">⚠️</a> <a href="#tool-thawkin3" title="Tools">🔧</a></td>
<td align="center"><a href="https://github.com/wandroll"><img src="https://avatars.githubusercontent.com/u/4492317?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Wandrille Verlut</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap-react/commits?author=wandroll" title="Code">💻</a> <a href="https://github.com/focus-trap/focus-trap-react/commits?author=wandroll" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/krikienoid"><img src="https://avatars3.githubusercontent.com/u/8528227?v=4?s=100" width="100px;" alt=""/><br /><sub><b>krikienoid</b></sub></a><br /><a href="https://github.com/focus-trap/focus-trap-react/issues?q=author%3Akrikienoid" title="Bug reports">🐛</a></td>

@@ -208,0 +209,0 @@ </tr>

@@ -90,4 +90,5 @@ const React = require('react');

updatePreviousElement() {
if (typeof document !== 'undefined') {
this.previouslyFocusedElement = document.activeElement;
const currentDocument = this.props.focusTrapOptions.document || document;
if (currentDocument) {
this.previouslyFocusedElement = currentDocument.activeElement;
}

@@ -245,2 +246,3 @@ }

focusTrapOptions: PropTypes.shape({
document: PropTypes.object,
onActivate: PropTypes.func,

@@ -247,0 +249,0 @@ onPostActivate: PropTypes.func,

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