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