@thecb/components 7.0.0-beta.2 → 7.0.0-beta.5
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
|
@@ -48,12 +48,14 @@ const Modal = ({
|
|
|
48
48
|
}) => {
|
|
49
49
|
const { isMobile } = useContext(ThemeContext);
|
|
50
50
|
const closeBtnRef = useRef(null);
|
|
51
|
+
const bodyTextContainerRef = useRef(null);
|
|
52
|
+
debugger;
|
|
51
53
|
return (
|
|
52
54
|
<Fragment>
|
|
53
55
|
{modalOpen && (
|
|
54
56
|
<AriaModal
|
|
55
|
-
initialFocus={closeBtnRef}
|
|
56
|
-
focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: closeBtnRef }} // fallback to resolve unit test errors
|
|
57
|
+
initialFocus={closeBtnRef ?? bodyTextContainerRef}
|
|
58
|
+
focusTrapOptions={{ delayInitialFocus: false, fallbackFocus: closeBtnRef ?? bodyTextContainerRef }} // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
|
|
57
59
|
onExit={onExit}
|
|
58
60
|
getApplicationNode={getApplicationNode}
|
|
59
61
|
titleText={modalHeaderText}
|
|
@@ -83,6 +85,7 @@ const Modal = ({
|
|
|
83
85
|
<Box background={modalBodyBg} padding="1.5rem">
|
|
84
86
|
<Stack childGap="1.5rem">
|
|
85
87
|
<Box
|
|
88
|
+
ref={bodyTextContainerRef}
|
|
86
89
|
borderWidthOverride={noBorder && "0 0 2px 0"}
|
|
87
90
|
borderColor={!noBorder && SILVER_GREY}
|
|
88
91
|
padding={!noBorder && "0 0 1.5rem 0"}
|