Socket
Socket
Sign inDemoInstall

focus-trap-react

Package Overview
Dependencies
Maintainers
1
Versions
69
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 3.1.2 to 3.1.3

4

CHANGELOG.md
# Changelog
## 3.1.3
- Remove `componentWillMount` usage.
## 3.1.2

@@ -4,0 +8,0 @@

26

dist/focus-trap-react.js

@@ -19,26 +19,18 @@ 'use strict';

function FocusTrap() {
var _ref;
function FocusTrap(props) {
_classCallCheck(this, FocusTrap);
var _temp, _this, _ret;
var _this = _possibleConstructorReturn(this, (FocusTrap.__proto__ || Object.getPrototypeOf(FocusTrap)).call(this, props));
_classCallCheck(this, FocusTrap);
_this.setNode = function (el) {
_this.node = el;
};
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
if (typeof document !== 'undefined') {
_this.previouslyFocusedElement = document.activeElement;
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FocusTrap.__proto__ || Object.getPrototypeOf(FocusTrap)).call.apply(_ref, [this].concat(args))), _this), _this.setNode = function (el) {
_this.node = el;
}, _temp), _possibleConstructorReturn(_this, _ret);
return _this;
}
_createClass(FocusTrap, [{
key: 'componentWillMount',
value: function componentWillMount() {
if (typeof document !== 'undefined') {
this.previouslyFocusedElement = document.activeElement;
}
}
}, {
key: 'componentDidMount',

@@ -45,0 +37,0 @@ value: function componentDidMount() {

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

@@ -22,2 +22,6 @@ "main": "dist/focus-trap-react.js",

},
"files": [
"dist",
"src"
],
"keywords": [

@@ -24,0 +28,0 @@ "react",

@@ -13,3 +13,5 @@ const React = require('react');

class FocusTrap extends React.Component {
componentWillMount() {
constructor(props) {
super(props)
if (typeof document !== 'undefined') {

@@ -16,0 +18,0 @@ this.previouslyFocusedElement = document.activeElement;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc