Skip to content

The open alternative to Salesforce, designed for AI.

[Dashboards] - Add scroll wrapper (#14561)

nitin09b9071182e5
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
index a123cec8289..4787ede0160 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutGridLayout.tsx
@@ -32,8 +32,6 @@ const StyledGridContainer = styled.div`
box-sizing: border-box;
flex: 1;
min-height: 100%;
- overflow-y: auto;
- overflow-x: hidden;
position: relative;
padding: ${({ theme }) => theme.spacing(2)};
width: 100%;
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx
index fdf258d8b21..4e81904b510 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx
@@ -2,13 +2,27 @@ import { PageLayoutGridLayout } from '@/page-layout/components/PageLayoutGridLay
import { useCurrentPageLayout } from '@/page-layout/hooks/useCurrentPageLayout';
import { getTabListInstanceIdFromPageLayoutId } from '@/page-layout/utils/getTabListInstanceIdFromPageLayoutId';
import { TabList } from '@/ui/layout/tab-list/components/TabList';
+import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import styled from '@emotion/styled';
import { isDefined } from 'twenty-shared/utils';
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ width: 100%;
+ overflow: hidden;
+ background: ${({ theme }) => theme.background.primary};
+`;
+
const StyledTabList = styled(TabList)`
padding-left: ${({ theme }) => theme.spacing(2)};
`;
+const StyledScrollWrapper = styled(ScrollWrapper)`
+ flex: 1;
+`;
+
export const PageLayoutRendererContent = () => {
const { currentPageLayout } = useCurrentPageLayout();
@@ -17,7 +31,7 @@ export const PageLayoutRendererContent = () => {
}
return (
- <>
+ <StyledContainer>
<StyledTabList
tabs={currentPageLayout.tabs}
behaveAsLinks={false}
@@ -25,7 +39,12 @@ export const PageLayoutRendererContent = () => {
currentPageLayout.id,
)}
/>
- <PageLayoutGridLayout />
- </>
+ <StyledScrollWrapper
+ componentInstanceId={`scroll-wrapper-page-layout-${currentPageLayout.id}`}
+ defaultEnableXScroll={false}
+ >
+ <PageLayoutGridLayout />
+ </StyledScrollWrapper>
+ </StyledContainer>
);
};