Fix pricing modal being cut off and unscrollabel on low resolution screens or when zoomed in (#8848)
Fixes: #7999 1. Summary I am not 100% sure why it's happening, but it seems `justify-content: center` conflicts with `overflow-y: auto` and that's why the modal content becomes unscrollable and cut off. 2. Solution To preserve the styling that centers the content inside the modal even when the content height is less than the modal, I moved `justify-content: center` from the content to the modal container. When the content overflows the modal, it seems `justify-content: center` does nothing, though. 3. Screen Recording https://github.com/user-attachments/assets/17d8ddbd-7fe8-46ce-b8d0-82d817ee7025 --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -29,7 +29,8 @@ const StyledModalDiv = styled(motion.div)<{
|
||||
if (isMobile) return `0`;
|
||||
return theme.border.radius.md;
|
||||
}};
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
z-index: 10000; // should be higher than Backdrop's z-index
|
||||
|
||||
width: ${({ isMobile, size, theme }) => {
|
||||
@ -79,7 +80,6 @@ const StyledContent = styled.div`
|
||||
flex: 1;
|
||||
flex: 1 1 0%;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
padding: ${({ theme }) => theme.spacing(10)};
|
||||
`;
|
||||
|
||||
|
||||
@ -126,24 +126,24 @@ export const DefaultLayout = () => {
|
||||
) : (
|
||||
<StyledAppNavigationDrawer />
|
||||
)}
|
||||
<StyledMainContainer>
|
||||
{showAuthModal ? (
|
||||
<>
|
||||
<SignInBackgroundMockPage />
|
||||
<AnimatePresence mode="wait">
|
||||
<LayoutGroup>
|
||||
<AuthModal>
|
||||
<Outlet />
|
||||
</AuthModal>
|
||||
</LayoutGroup>
|
||||
</AnimatePresence>
|
||||
</>
|
||||
) : (
|
||||
{showAuthModal ? (
|
||||
<>
|
||||
<SignInBackgroundMockPage />
|
||||
<AnimatePresence mode="wait">
|
||||
<LayoutGroup>
|
||||
<AuthModal>
|
||||
<Outlet />
|
||||
</AuthModal>
|
||||
</LayoutGroup>
|
||||
</AnimatePresence>
|
||||
</>
|
||||
) : (
|
||||
<StyledMainContainer>
|
||||
<AppErrorBoundary>
|
||||
<Outlet />
|
||||
</AppErrorBoundary>
|
||||
)}
|
||||
</StyledMainContainer>
|
||||
</StyledMainContainer>
|
||||
)}
|
||||
</StyledPageContainer>
|
||||
{isMobile && <MobileNavigationBar />}
|
||||
</StyledLayout>
|
||||
|
||||
Reference in New Issue
Block a user