Skip to content

Commit 1a3883c

Browse files
Modal: fix external styling classes on modal/drawer not working
1 parent 2f871a5 commit 1a3883c

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

client/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ function UIView(props: {
219219
viewFn: any;
220220
}) {
221221
const comp = props.comp;
222-
223222
const childrenProps = childrenToProps(comp.children);
224223
const parentDisabled = useContext(DisabledContext);
225224
const disabled = childrenProps["disabled"];
@@ -236,6 +235,17 @@ function UIView(props: {
236235
}
237236
//END ADD BY FRED
238237

238+
if (comp.children.hasOwnProperty('showMask') && comp.children.hasOwnProperty('maskClosable')) {
239+
return (
240+
<HidableView hidden={childrenProps.hidden as boolean}>
241+
{props.viewFn(
242+
childrenProps,
243+
comp.dispatch
244+
)}
245+
</HidableView>
246+
);
247+
}
248+
239249
return (
240250
<div
241251
ref={props.innerRef}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ let TmpDrawerComp = (function () {
167167
zIndex={Layers.drawer}
168168
maskClosable={props.maskClosable}
169169
mask={props.showMask}
170+
className={props.className as string}
171+
data-testid={props.dataTestId as string}
170172
>
171173
<ButtonStyle
172174
$closePosition={props.closePosition}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { trans } from "i18n";
2626
import _ from "lodash";
2727
import dayjs from "dayjs";
2828
import { ConstructorToComp } from "lowcoder-core";
29-
import { Section, sectionNames } from "lowcoder-design";
29+
import { ScrollBar, Section, sectionNames } from "lowcoder-design";
3030
import React, { useContext, useEffect, useMemo } from "react";
3131
import { useInterval, useTitle, useWindowSize } from "react-use";
3232
import { useCurrentUser } from "util/currentUser";
@@ -204,7 +204,9 @@ export class HookComp extends HookTmpComp {
204204
return (
205205
<>
206206
<CompName name={this.children.name.getView()} />
207-
{this.children.comp.getPropertyView()}
207+
<ScrollBar>
208+
{this.children.comp.getPropertyView()}
209+
</ScrollBar>
208210
</>
209211
);
210212
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ let TmpModalComp = (function () {
155155
zIndex={Layers.modal}
156156
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
157157
mask={props.showMask}
158+
className={props.className as string}
159+
data-testid={props.dataTestId as string}
158160
>
159161
<InnerGrid
160162
{...otherContainerProps}

0 commit comments

Comments
 (0)