@thecb/components 7.0.0-beta.3 → 7.0.0-beta.4
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.esm.js
CHANGED
|
@@ -43329,12 +43329,14 @@ var Modal$1 = function Modal(_ref) {
|
|
|
43329
43329
|
var _useContext = useContext(ThemeContext),
|
|
43330
43330
|
isMobile = _useContext.isMobile;
|
|
43331
43331
|
|
|
43332
|
+
var closeBtnRef = useRef(null);
|
|
43332
43333
|
var bodyTextContainerRef = useRef(null);
|
|
43334
|
+
debugger;
|
|
43333
43335
|
return /*#__PURE__*/React.createElement(Fragment$1, null, modalOpen && /*#__PURE__*/React.createElement(reactAriaModal, {
|
|
43334
|
-
initialFocus: bodyTextContainerRef,
|
|
43336
|
+
initialFocus: closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef,
|
|
43335
43337
|
focusTrapOptions: {
|
|
43336
43338
|
delayInitialFocus: true,
|
|
43337
|
-
fallbackFocus: bodyTextContainerRef
|
|
43339
|
+
fallbackFocus: closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef
|
|
43338
43340
|
} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
|
|
43339
43341
|
,
|
|
43340
43342
|
onExit: onExit,
|
|
@@ -43433,6 +43435,7 @@ var Modal$1 = function Modal(_ref) {
|
|
|
43433
43435
|
}))) : /*#__PURE__*/React.createElement(Box, {
|
|
43434
43436
|
padding: "0.5rem"
|
|
43435
43437
|
}, /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
43438
|
+
ref: closeBtnRef,
|
|
43436
43439
|
action: hideModal,
|
|
43437
43440
|
variant: "primary",
|
|
43438
43441
|
text: closeButtonText,
|