@thecb/components 7.0.0-beta.3 → 7.0.0-beta.6
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/dist/index.cjs.js
CHANGED
|
@@ -43297,6 +43297,8 @@ var getApplicationNode = function getApplicationNode() {
|
|
|
43297
43297
|
};
|
|
43298
43298
|
|
|
43299
43299
|
var Modal$1 = function Modal(_ref) {
|
|
43300
|
+
var _ref2, _ref3;
|
|
43301
|
+
|
|
43300
43302
|
var hideModal = _ref.hideModal,
|
|
43301
43303
|
_ref$onExit = _ref.onExit,
|
|
43302
43304
|
onExit = _ref$onExit === void 0 ? hideModal : _ref$onExit,
|
|
@@ -43337,12 +43339,14 @@ var Modal$1 = function Modal(_ref) {
|
|
|
43337
43339
|
var _useContext = React.useContext(styled.ThemeContext),
|
|
43338
43340
|
isMobile = _useContext.isMobile;
|
|
43339
43341
|
|
|
43342
|
+
var closeBtnRef = React.useRef(null);
|
|
43340
43343
|
var bodyTextContainerRef = React.useRef(null);
|
|
43344
|
+
debugger;
|
|
43341
43345
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
|
|
43342
|
-
initialFocus: bodyTextContainerRef,
|
|
43346
|
+
initialFocus: (_ref2 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref2 !== void 0 ? _ref2 : '#root',
|
|
43343
43347
|
focusTrapOptions: {
|
|
43344
|
-
delayInitialFocus:
|
|
43345
|
-
fallbackFocus: bodyTextContainerRef
|
|
43348
|
+
delayInitialFocus: false,
|
|
43349
|
+
fallbackFocus: (_ref3 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref3 !== void 0 ? _ref3 : '#root'
|
|
43346
43350
|
} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
|
|
43347
43351
|
,
|
|
43348
43352
|
onExit: onExit,
|
|
@@ -43441,6 +43445,7 @@ var Modal$1 = function Modal(_ref) {
|
|
|
43441
43445
|
}))) : /*#__PURE__*/React__default.createElement(Box, {
|
|
43442
43446
|
padding: "0.5rem"
|
|
43443
43447
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
43448
|
+
ref: closeBtnRef,
|
|
43444
43449
|
action: hideModal,
|
|
43445
43450
|
variant: "primary",
|
|
43446
43451
|
text: closeButtonText,
|