fix(striker-ui): adjust combine scroll box branching in ConfirmDialog

main
Tsu-ba-me 1 year ago
parent 3431cac5dd
commit f064623dd3
  1. 10
      striker-ui/components/ConfirmDialog.tsx

@ -203,10 +203,9 @@ const ConfirmDialog = forwardRef<
), ),
[titleText], [titleText],
); );
const combinedScrollBoxSx = useMemo(() => { const combinedScrollBoxSx = useMemo<SxProps<Theme> | undefined>(() => {
let result: SxProps<Theme> | undefined; if (!isScrollContent) return scrollBoxSx;
if (isScrollContent) {
let overflowX: 'hidden' | undefined; let overflowX: 'hidden' | undefined;
let paddingTop: string | undefined; let paddingTop: string | undefined;
@ -215,7 +214,7 @@ const ConfirmDialog = forwardRef<
paddingTop = '.6em'; paddingTop = '.6em';
} }
result = { return {
maxHeight: '60vh', maxHeight: '60vh',
overflowX, overflowX,
overflowY: 'scroll', overflowY: 'scroll',
@ -223,9 +222,6 @@ const ConfirmDialog = forwardRef<
paddingTop, paddingTop,
...scrollBoxSx, ...scrollBoxSx,
}; };
}
return result;
}, [isFormContent, isScrollContent, scrollBoxSx]); }, [isFormContent, isScrollContent, scrollBoxSx]);
const contentAreaElement = useMemo( const contentAreaElement = useMemo(

Loading…
Cancel
Save