From 18533ba0c8ad8b8a7d47b4bb9fc8606bbfe085c7 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Sat, 25 Mar 2023 01:16:11 -0400 Subject: [PATCH] fix(striker-ui): move scroll style offsets to ConfirmDialog --- striker-ui/components/ConfirmDialog.tsx | 35 +++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/striker-ui/components/ConfirmDialog.tsx b/striker-ui/components/ConfirmDialog.tsx index 5252b248..319bf313 100644 --- a/striker-ui/components/ConfirmDialog.tsx +++ b/striker-ui/components/ConfirmDialog.tsx @@ -203,17 +203,30 @@ const ConfirmDialog = forwardRef< ), [titleText], ); - const combinedScrollBoxSx = useMemo | undefined>( - () => - isScrollContent - ? { - maxHeight: '60vh', - overflowY: 'scroll', - ...scrollBoxSx, - } - : undefined, - [isScrollContent, scrollBoxSx], - ); + const combinedScrollBoxSx = useMemo(() => { + let result: SxProps | undefined; + + if (isScrollContent) { + let overflowX: 'hidden' | undefined; + let paddingTop: string | undefined; + + if (isFormContent) { + overflowX = 'hidden'; + paddingTop = '.6em'; + } + + result = { + maxHeight: '60vh', + overflowX, + overflowY: 'scroll', + paddingRight: '.4em', + paddingTop, + ...scrollBoxSx, + }; + } + + return result; + }, [isFormContent, isScrollContent, scrollBoxSx]); const contentAreaElement = useMemo( () =>