@thecb/components 7.0.0-beta.2 → 7.0.0-beta.3

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.2",
3
+ "version": "7.0.0-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -47,13 +47,14 @@ const Modal = ({
47
47
  children
48
48
  }) => {
49
49
  const { isMobile } = useContext(ThemeContext);
50
- const closeBtnRef = useRef(null);
50
+ const bodyTextContainerRef = useRef(null);
51
+
51
52
  return (
52
53
  <Fragment>
53
54
  {modalOpen && (
54
55
  <AriaModal
55
- initialFocus={closeBtnRef}
56
- focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: closeBtnRef }} // fallback to resolve unit test errors with Jest/tabbable https://github.com/focus-trap/focus-trap-react/issues/91
56
+ initialFocus={bodyTextContainerRef}
57
+ focusTrapOptions={{ delayInitialFocus: true, fallbackFocus: bodyTextContainerRef }} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
57
58
  onExit={onExit}
58
59
  getApplicationNode={getApplicationNode}
59
60
  titleText={modalHeaderText}
@@ -83,6 +84,7 @@ const Modal = ({
83
84
  <Box background={modalBodyBg} padding="1.5rem">
84
85
  <Stack childGap="1.5rem">
85
86
  <Box
87
+ ref={bodyTextContainerRef}
86
88
  borderWidthOverride={noBorder && "0 0 2px 0"}
87
89
  borderColor={!noBorder && SILVER_GREY}
88
90
  padding={!noBorder && "0 0 1.5rem 0"}
@@ -172,7 +174,6 @@ const Modal = ({
172
174
  ) : (
173
175
  <Box padding="0.5rem">
174
176
  <ButtonWithAction
175
- ref={closeBtnRef}
176
177
  action={hideModal}
177
178
  variant="primary"
178
179
  text={closeButtonText}