Skip to content

Commit 9279376

Browse files
committed
Drawer: Added Main Content Scrollbar
1 parent 9973b1e commit 9279376

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ const DrawerWrapper = styled.div`
4141
}
4242
`;
4343

44-
const StyledDrawer = styled(Drawer)<{$titleAlign?: string}>`
44+
const StyledDrawer = styled(Drawer)<{$titleAlign?: string, $drawerScrollbar: boolean}>`
4545
.ant-drawer-header-title {
4646
margin: 0px 20px !important;
4747
text-align: ${(props) => props.$titleAlign || "center"};
4848
}
49+
div.ant-drawer-body div.react-grid-layout::-webkit-scrollbar {
50+
display: ${(props) => props.$drawerScrollbar ? "block" : "none"};
51+
}
4952
`;
5053

5154
const ButtonStyle = styled(Button)<{$closePosition?: string, $title? :string}>`
@@ -93,6 +96,7 @@ let TmpDrawerComp = (function () {
9396
titleAlign: HorizontalAlignmentControl,
9497
horizontalGridCells: SliderControl,
9598
autoHeight: AutoHeightControl,
99+
drawerScrollbar: withDefault(BoolControl, true),
96100
style: styleControl(DrawerStyle),
97101
placement: PositionControl,
98102
closePosition: withDefault(LeftRightControl, "left"),
@@ -137,6 +141,7 @@ let TmpDrawerComp = (function () {
137141
}}
138142
title={props.title}
139143
$titleAlign={props.titleAlign}
144+
$drawerScrollbar={props.drawerScrollbar}
140145
closable={false}
141146
placement={props.placement}
142147
open={props.visible.value}
@@ -209,6 +214,7 @@ let TmpDrawerComp = (function () {
209214
{children.horizontalGridCells.propertyView({
210215
label: trans('prop.horizontalGridCells'),
211216
})}
217+
{children.drawerScrollbar.propertyView({ label: trans("prop.drawerScrollbar") })}
212218
{children.maskClosable.propertyView({
213219
label: trans("prop.maskClosable"),
214220
})}

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ export const en = {
205205
"siderScrollbar" : "Show Scrollbars in Sider",
206206
"mainScrollbar": "Show Scrollbars in main content",
207207
"modalScrollbar": "Show Scrollbars in Modal",
208+
"drawerScrollbar": "Show Scrollbars in Drawer",
208209
"siderRight" : "Show sider on the Right",
209210
"siderWidth" : "Sider Width",
210211
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export const en = {
198198
"siderScrollbar": "Show Scrollbars in Sider",
199199
"mainScrollbar": "Show Scrollbars in main content",
200200
"modalScrollbar": "Show Scrollbars in Modal",
201+
"drawerScrollbar": "Show Scrollbars in Drawer",
201202
"siderRight": "Show sider on the Right",
202203
"siderWidth": "Sider Width",
203204
"siderWidthTooltip": "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export const en = {
203203
"siderScrollbar" : "Show Scrollbars in Sider",
204204
"mainScrollbar": "Show Scrollbars in main content",
205205
"modalScrollbar": "Show Scrollbars in Modal",
206+
"drawerScrollbar": "Show Scrollbars in Drawer",
206207
"siderRight" : "Show sider on the Right",
207208
"siderWidth" : "Sider Width",
208209
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

0 commit comments

Comments
 (0)