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

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

@ -203,29 +203,25 @@ 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;
if (isFormContent) { if (isFormContent) {
overflowX = 'hidden'; overflowX = 'hidden';
paddingTop = '.6em'; paddingTop = '.6em';
}
result = {
maxHeight: '60vh',
overflowX,
overflowY: 'scroll',
paddingRight: '.4em',
paddingTop,
...scrollBoxSx,
};
} }
return result; return {
maxHeight: '60vh',
overflowX,
overflowY: 'scroll',
paddingRight: '.4em',
paddingTop,
...scrollBoxSx,
};
}, [isFormContent, isScrollContent, scrollBoxSx]); }, [isFormContent, isScrollContent, scrollBoxSx]);
const contentAreaElement = useMemo( const contentAreaElement = useMemo(

Loading…
Cancel
Save