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