focus-trap-react 8.11.0 → 8.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/focus-trap-react.js +70 -42
- package/package.json +20 -18
- package/src/focus-trap-react.js +50 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9947461: Bump focus-trap dependency to v6.9.4 to get typings fix.
|
|
8
|
+
- 519e5a5: Fix setReturnFocus option as function not being passed node focused prior to activation.
|
|
9
|
+
|
|
10
|
+
## 8.11.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 7547d93: Bumps focus-trap to v6.9.3 to pick-up some small bug fixes from underlying tabbable.
|
|
15
|
+
|
|
16
|
+
## 8.11.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 040813a: Bumps focus-trap to v6.9.1 to pick-up a fix to tabbable in v5.3.2 regarding the `displayCheck=full` (default) option behavior that caused issues with detached nodes.
|
|
21
|
+
|
|
3
22
|
## 8.11.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/focus-trap-react.js
CHANGED
|
@@ -10,7 +10,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
10
10
|
|
|
11
11
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
12
12
|
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
14
|
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
16
|
|
|
@@ -20,7 +20,9 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
20
20
|
|
|
21
21
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
22
|
|
|
23
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
+
|
|
25
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
26
|
|
|
25
27
|
var React = require('react');
|
|
26
28
|
|
|
@@ -50,6 +52,49 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
50
52
|
_classCallCheck(this, FocusTrap);
|
|
51
53
|
|
|
52
54
|
_this = _super.call(this, props);
|
|
55
|
+
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "getNodeForOption", function (optionName) {
|
|
57
|
+
var _this$internalOptions;
|
|
58
|
+
|
|
59
|
+
// use internal options first, falling back to original options
|
|
60
|
+
var optionValue = (_this$internalOptions = this.internalOptions[optionName]) !== null && _this$internalOptions !== void 0 ? _this$internalOptions : this.originalOptions[optionName];
|
|
61
|
+
|
|
62
|
+
if (typeof optionValue === 'function') {
|
|
63
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
64
|
+
params[_key - 1] = arguments[_key];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
optionValue = optionValue.apply(void 0, params);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (optionValue === true) {
|
|
71
|
+
optionValue = undefined; // use default value
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!optionValue) {
|
|
75
|
+
if (optionValue === undefined || optionValue === false) {
|
|
76
|
+
return optionValue;
|
|
77
|
+
} // else, empty string (invalid), null (invalid), 0 (invalid)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node"));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
84
|
+
|
|
85
|
+
if (typeof optionValue === 'string') {
|
|
86
|
+
var _this$getDocument;
|
|
87
|
+
|
|
88
|
+
node = (_this$getDocument = this.getDocument()) === null || _this$getDocument === void 0 ? void 0 : _this$getDocument.querySelector(optionValue); // resolve to node, or null if fails
|
|
89
|
+
|
|
90
|
+
if (!node) {
|
|
91
|
+
throw new Error("`".concat(optionName, "` as selector refers to no known node"));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return node;
|
|
96
|
+
});
|
|
97
|
+
|
|
53
98
|
_this.handleDeactivate = _this.handleDeactivate.bind(_assertThisInitialized(_this));
|
|
54
99
|
_this.handlePostDeactivate = _this.handlePostDeactivate.bind(_assertThisInitialized(_this));
|
|
55
100
|
_this.handleClickOutsideDeactivates = _this.handleClickOutsideDeactivates.bind(_assertThisInitialized(_this)); // focus-trap options used internally when creating the trap
|
|
@@ -74,10 +119,10 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
74
119
|
}; // original options provided by the consumer
|
|
75
120
|
|
|
76
121
|
_this.originalOptions = {
|
|
77
|
-
// because of the above `
|
|
122
|
+
// because of the above `internalOptions`, we maintain our own flag for
|
|
78
123
|
// this option, and default it to `true` because that's focus-trap's default
|
|
79
124
|
returnFocusOnDeactivate: true,
|
|
80
|
-
// because of the above `
|
|
125
|
+
// because of the above `internalOptions`, we keep these separate since
|
|
81
126
|
// they're part of the deactivation process which we configure (internally) to
|
|
82
127
|
// be shared between focus-trap and focus-trap-react
|
|
83
128
|
onDeactivate: null,
|
|
@@ -95,7 +140,7 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
95
140
|
|
|
96
141
|
if (optionName === 'returnFocusOnDeactivate' || optionName === 'onDeactivate' || optionName === 'onPostDeactivate' || optionName === 'checkCanReturnFocus' || optionName === 'clickOutsideDeactivates') {
|
|
97
142
|
_this.originalOptions[optionName] = focusTrapOptions[optionName];
|
|
98
|
-
continue; // exclude from
|
|
143
|
+
continue; // exclude from internalOptions
|
|
99
144
|
}
|
|
100
145
|
|
|
101
146
|
_this.internalOptions[optionName] = focusTrapOptions[optionName];
|
|
@@ -128,44 +173,26 @@ var FocusTrap = /*#__PURE__*/function (_React$Component) {
|
|
|
128
173
|
value: function getDocument() {
|
|
129
174
|
// SSR: careful to check if `document` exists before accessing it as a variable
|
|
130
175
|
return this.props.focusTrapOptions.document || (typeof document !== 'undefined' ? document : undefined);
|
|
131
|
-
} // TODO: Need more test coverage for this function
|
|
132
|
-
|
|
133
|
-
}, {
|
|
134
|
-
key: "getNodeForOption",
|
|
135
|
-
value: function getNodeForOption(optionName) {
|
|
136
|
-
var optionValue = this.internalOptions[optionName];
|
|
137
|
-
|
|
138
|
-
if (!optionValue) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
var node = optionValue;
|
|
143
|
-
|
|
144
|
-
if (typeof optionValue === 'string') {
|
|
145
|
-
var _this$getDocument;
|
|
146
|
-
|
|
147
|
-
node = (_this$getDocument = this.getDocument()) === null || _this$getDocument === void 0 ? void 0 : _this$getDocument.querySelector(optionValue);
|
|
148
|
-
|
|
149
|
-
if (!node) {
|
|
150
|
-
throw new Error("`".concat(optionName, "` refers to no known node"));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (typeof optionValue === 'function') {
|
|
155
|
-
node = optionValue();
|
|
156
|
-
|
|
157
|
-
if (!node) {
|
|
158
|
-
throw new Error("`".concat(optionName, "` did not return a node"));
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return node;
|
|
163
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Gets the node for the given option, which is expected to be an option that
|
|
179
|
+
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
180
|
+
* (if a node is explicitly NOT given), or a function that returns any of these
|
|
181
|
+
* values.
|
|
182
|
+
* @param {string} optionName
|
|
183
|
+
* @returns {undefined | false | HTMLElement | SVGElement} Returns
|
|
184
|
+
* `undefined` if the option is not specified; `false` if the option
|
|
185
|
+
* resolved to `false` (node explicitly not given); otherwise, the resolved
|
|
186
|
+
* DOM node.
|
|
187
|
+
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
188
|
+
* resolve to a node.
|
|
189
|
+
*/
|
|
190
|
+
|
|
164
191
|
}, {
|
|
165
192
|
key: "getReturnFocusNode",
|
|
166
193
|
value: function getReturnFocusNode() {
|
|
167
|
-
var node = this.getNodeForOption('setReturnFocus');
|
|
168
|
-
return node ? node : this.previouslyFocusedElement;
|
|
194
|
+
var node = this.getNodeForOption('setReturnFocus', this.previouslyFocusedElement);
|
|
195
|
+
return node ? node : node === false ? false : this.previouslyFocusedElement;
|
|
169
196
|
}
|
|
170
197
|
/** Update the previously focused element with the currently focused element. */
|
|
171
198
|
|
|
@@ -417,12 +444,13 @@ FocusTrap.propTypes = {
|
|
|
417
444
|
onDeactivate: PropTypes.func,
|
|
418
445
|
onPostDeactivate: PropTypes.func,
|
|
419
446
|
checkCanReturnFocus: PropTypes.func,
|
|
420
|
-
initialFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.
|
|
421
|
-
fallbackFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string,
|
|
447
|
+
initialFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.bool, PropTypes.func]),
|
|
448
|
+
fallbackFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, // NOTE: does not support `false` as value (or return value from function)
|
|
449
|
+
PropTypes.func]),
|
|
422
450
|
escapeDeactivates: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
423
451
|
clickOutsideDeactivates: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
424
452
|
returnFocusOnDeactivate: PropTypes.bool,
|
|
425
|
-
setReturnFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.func]),
|
|
453
|
+
setReturnFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.bool, PropTypes.func]),
|
|
426
454
|
allowOutsideClick: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
427
455
|
preventScroll: PropTypes.bool,
|
|
428
456
|
tabbableOptions: PropTypes.shape({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "focus-trap-react",
|
|
3
|
-
"version": "8.11.
|
|
3
|
+
"version": "8.11.3",
|
|
4
4
|
"description": "A React component that traps focus.",
|
|
5
5
|
"main": "dist/focus-trap-react.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -57,43 +57,45 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/focus-trap/focus-trap-react#readme",
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@babel/cli": "^7.17.
|
|
61
|
-
"@babel/core": "^7.
|
|
62
|
-
"@babel/eslint-parser": "^7.
|
|
63
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
64
|
-
"@babel/preset-env": "^7.
|
|
65
|
-
"@babel/preset-react": "^7.
|
|
60
|
+
"@babel/cli": "^7.17.10",
|
|
61
|
+
"@babel/core": "^7.18.2",
|
|
62
|
+
"@babel/eslint-parser": "^7.18.2",
|
|
63
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
64
|
+
"@babel/preset-env": "^7.18.2",
|
|
65
|
+
"@babel/preset-react": "^7.17.12",
|
|
66
66
|
"@changesets/cli": "^2.22.0",
|
|
67
|
-
"@testing-library/cypress": "^8.0.
|
|
67
|
+
"@testing-library/cypress": "^8.0.3",
|
|
68
68
|
"@testing-library/dom": "^8.13.0",
|
|
69
69
|
"@testing-library/jest-dom": "^5.16.4",
|
|
70
|
-
"@testing-library/react": "^13.
|
|
71
|
-
"@testing-library/user-event": "^14.
|
|
70
|
+
"@testing-library/react": "^13.3.0",
|
|
71
|
+
"@testing-library/user-event": "^14.2.0",
|
|
72
72
|
"@types/jquery": "^3.5.14",
|
|
73
73
|
"all-contributors-cli": "^6.20.0",
|
|
74
|
-
"babel-jest": "^28.
|
|
74
|
+
"babel-jest": "^28.1.1",
|
|
75
75
|
"babelify": "^10.0.0",
|
|
76
76
|
"browserify": "^17.0.0",
|
|
77
77
|
"budo": "^11.7.0",
|
|
78
|
-
"cypress": "^9.
|
|
78
|
+
"cypress": "^9.7.0",
|
|
79
79
|
"cypress-plugin-tab": "^1.0.5",
|
|
80
|
-
"eslint": "^8.
|
|
80
|
+
"eslint": "^8.17.0",
|
|
81
81
|
"eslint-config-prettier": "^8.5.0",
|
|
82
82
|
"eslint-plugin-cypress": "^2.12.1",
|
|
83
|
-
"eslint-plugin-
|
|
84
|
-
"
|
|
83
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
84
|
+
"eslint-plugin-react": "^7.30.0",
|
|
85
|
+
"jest": "^28.1.1",
|
|
86
|
+
"jest-environment-jsdom": "^28.1.1",
|
|
85
87
|
"jest-watch-typeahead": "^1.1.0",
|
|
86
88
|
"onchange": "^7.1.0",
|
|
87
89
|
"prettier": "^2.6.2",
|
|
88
90
|
"prop-types": "^15.8.1",
|
|
89
91
|
"react": "^18.1.0",
|
|
90
|
-
"react-dom": "^18.
|
|
92
|
+
"react-dom": "^18.1.0",
|
|
91
93
|
"regenerator-runtime": "^0.13.9",
|
|
92
94
|
"start-server-and-test": "^1.14.0",
|
|
93
|
-
"typescript": "^4.
|
|
95
|
+
"typescript": "^4.7.3"
|
|
94
96
|
},
|
|
95
97
|
"dependencies": {
|
|
96
|
-
"focus-trap": "^6.9.
|
|
98
|
+
"focus-trap": "^6.9.4"
|
|
97
99
|
},
|
|
98
100
|
"peerDependencies": {
|
|
99
101
|
"prop-types": "^15.8.1",
|
package/src/focus-trap-react.js
CHANGED
|
@@ -42,11 +42,11 @@ class FocusTrap extends React.Component {
|
|
|
42
42
|
|
|
43
43
|
// original options provided by the consumer
|
|
44
44
|
this.originalOptions = {
|
|
45
|
-
// because of the above `
|
|
45
|
+
// because of the above `internalOptions`, we maintain our own flag for
|
|
46
46
|
// this option, and default it to `true` because that's focus-trap's default
|
|
47
47
|
returnFocusOnDeactivate: true,
|
|
48
48
|
|
|
49
|
-
// because of the above `
|
|
49
|
+
// because of the above `internalOptions`, we keep these separate since
|
|
50
50
|
// they're part of the deactivation process which we configure (internally) to
|
|
51
51
|
// be shared between focus-trap and focus-trap-react
|
|
52
52
|
onDeactivate: null,
|
|
@@ -71,7 +71,7 @@ class FocusTrap extends React.Component {
|
|
|
71
71
|
optionName === 'clickOutsideDeactivates'
|
|
72
72
|
) {
|
|
73
73
|
this.originalOptions[optionName] = focusTrapOptions[optionName];
|
|
74
|
-
continue; // exclude from
|
|
74
|
+
continue; // exclude from internalOptions
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
this.internalOptions[optionName] = focusTrapOptions[optionName];
|
|
@@ -106,36 +106,63 @@ class FocusTrap extends React.Component {
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Gets the node for the given option, which is expected to be an option that
|
|
111
|
+
* can be either a DOM node, a string that is a selector to get a node, `false`
|
|
112
|
+
* (if a node is explicitly NOT given), or a function that returns any of these
|
|
113
|
+
* values.
|
|
114
|
+
* @param {string} optionName
|
|
115
|
+
* @returns {undefined | false | HTMLElement | SVGElement} Returns
|
|
116
|
+
* `undefined` if the option is not specified; `false` if the option
|
|
117
|
+
* resolved to `false` (node explicitly not given); otherwise, the resolved
|
|
118
|
+
* DOM node.
|
|
119
|
+
* @throws {Error} If the option is set, not `false`, and is not, or does not
|
|
120
|
+
* resolve to a node.
|
|
121
|
+
*/
|
|
122
|
+
getNodeForOption = function (optionName, ...params) {
|
|
123
|
+
// use internal options first, falling back to original options
|
|
124
|
+
let optionValue =
|
|
125
|
+
this.internalOptions[optionName] ?? this.originalOptions[optionName];
|
|
126
|
+
|
|
127
|
+
if (typeof optionValue === 'function') {
|
|
128
|
+
optionValue = optionValue(...params);
|
|
114
129
|
}
|
|
115
130
|
|
|
116
|
-
|
|
131
|
+
if (optionValue === true) {
|
|
132
|
+
optionValue = undefined; // use default value
|
|
133
|
+
}
|
|
117
134
|
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
throw new Error(`\`${optionName}\` refers to no known node`);
|
|
135
|
+
if (!optionValue) {
|
|
136
|
+
if (optionValue === undefined || optionValue === false) {
|
|
137
|
+
return optionValue;
|
|
122
138
|
}
|
|
139
|
+
// else, empty string (invalid), null (invalid), 0 (invalid)
|
|
140
|
+
|
|
141
|
+
throw new Error(
|
|
142
|
+
`\`${optionName}\` was specified but was not a node, or did not return a node`
|
|
143
|
+
);
|
|
123
144
|
}
|
|
124
145
|
|
|
125
|
-
|
|
126
|
-
|
|
146
|
+
let node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point
|
|
147
|
+
|
|
148
|
+
if (typeof optionValue === 'string') {
|
|
149
|
+
node = this.getDocument()?.querySelector(optionValue); // resolve to node, or null if fails
|
|
127
150
|
if (!node) {
|
|
128
|
-
throw new Error(
|
|
151
|
+
throw new Error(
|
|
152
|
+
`\`${optionName}\` as selector refers to no known node`
|
|
153
|
+
);
|
|
129
154
|
}
|
|
130
155
|
}
|
|
131
156
|
|
|
132
157
|
return node;
|
|
133
|
-
}
|
|
158
|
+
};
|
|
134
159
|
|
|
135
160
|
getReturnFocusNode() {
|
|
136
|
-
const node = this.getNodeForOption(
|
|
137
|
-
|
|
138
|
-
|
|
161
|
+
const node = this.getNodeForOption(
|
|
162
|
+
'setReturnFocus',
|
|
163
|
+
this.previouslyFocusedElement
|
|
164
|
+
);
|
|
165
|
+
return node ? node : node === false ? false : this.previouslyFocusedElement;
|
|
139
166
|
}
|
|
140
167
|
|
|
141
168
|
/** Update the previously focused element with the currently focused element. */
|
|
@@ -395,12 +422,13 @@ FocusTrap.propTypes = {
|
|
|
395
422
|
initialFocus: PropTypes.oneOfType([
|
|
396
423
|
PropTypes.instanceOf(ElementType),
|
|
397
424
|
PropTypes.string,
|
|
398
|
-
PropTypes.func,
|
|
399
425
|
PropTypes.bool,
|
|
426
|
+
PropTypes.func,
|
|
400
427
|
]),
|
|
401
428
|
fallbackFocus: PropTypes.oneOfType([
|
|
402
429
|
PropTypes.instanceOf(ElementType),
|
|
403
430
|
PropTypes.string,
|
|
431
|
+
// NOTE: does not support `false` as value (or return value from function)
|
|
404
432
|
PropTypes.func,
|
|
405
433
|
]),
|
|
406
434
|
escapeDeactivates: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|
|
@@ -412,6 +440,7 @@ FocusTrap.propTypes = {
|
|
|
412
440
|
setReturnFocus: PropTypes.oneOfType([
|
|
413
441
|
PropTypes.instanceOf(ElementType),
|
|
414
442
|
PropTypes.string,
|
|
443
|
+
PropTypes.bool,
|
|
415
444
|
PropTypes.func,
|
|
416
445
|
]),
|
|
417
446
|
allowOutsideClick: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
|