@thecb/components 7.0.0-beta.6 → 7.0.0-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "7.0.0-beta.6",
3
+ "version": "7.0.0-beta.7",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -47,15 +47,15 @@ const Modal = ({
47
47
  children
48
48
  }) => {
49
49
  const { isMobile } = useContext(ThemeContext);
50
- const closeBtnRef = useRef(null);
51
- const bodyTextContainerRef = useRef(null);
52
- debugger;
50
+ const modalContainerRef = useRef(null);
51
+ // debugger;
53
52
  return (
54
- <Fragment>
53
+ <div ref={modalContainerRef}>
55
54
  {modalOpen && (
56
55
  <AriaModal
57
- initialFocus={closeBtnRef ?? bodyTextContainerRef ?? '#root'}
58
- focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: closeBtnRef ?? bodyTextContainerRef ?? '#root'}} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
56
+ // focusTrapPaused={true}
57
+ initialFocus={modalContainerRef?.current}
58
+ focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: modalContainerRef?.current }} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
59
59
  onExit={onExit}
60
60
  getApplicationNode={getApplicationNode}
61
61
  titleText={modalHeaderText}
@@ -85,7 +85,6 @@ const Modal = ({
85
85
  <Box background={modalBodyBg} padding="1.5rem">
86
86
  <Stack childGap="1.5rem">
87
87
  <Box
88
- ref={bodyTextContainerRef}
89
88
  borderWidthOverride={noBorder && "0 0 2px 0"}
90
89
  borderColor={!noBorder && SILVER_GREY}
91
90
  padding={!noBorder && "0 0 1.5rem 0"}
@@ -175,7 +174,6 @@ const Modal = ({
175
174
  ) : (
176
175
  <Box padding="0.5rem">
177
176
  <ButtonWithAction
178
- ref={closeBtnRef}
179
177
  action={hideModal}
180
178
  variant="primary"
181
179
  text={closeButtonText}
@@ -195,7 +193,7 @@ const Modal = ({
195
193
  </AriaModal>
196
194
  )}
197
195
  {children}
198
- </Fragment>
196
+ </div>
199
197
  );
200
198
  };
201
199