Skip to content

Commit 2098b44

Browse files
stop overriding dynamic styles
1 parent 55bd8f5 commit 2098b44

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

client/packages/lowcoder/src/comps/comps/textComp.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ let TextTmpComp = (function () {
150150
};
151151
return new UICompBuilder(childrenMap, (props, dispatch) => {
152152
const value = props.text.value;
153-
154-
useMergeCompStyles(
155-
props as Record<string, any>,
156-
dispatch
157-
);
153+
154+
// useMergeCompStyles(
155+
// props as Record<string, any>,
156+
// dispatch
157+
// );
158158

159159
return (
160160
<TextContainer

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { UICompType, uiCompRegistry } from "../uiCompRegistry";
3333
import { getNpmPackageMeta } from "../utils/remote";
3434
import { compPluginsList } from "constants/compPluginConstants";
3535
import Select from "antd/es/select";
36+
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
3637

3738
export type NewChildren<ChildrenCompMap extends Record<string, Comp<unknown>>> =
3839
ChildrenCompMap & {
@@ -281,6 +282,7 @@ function UIView(props: {
281282
}) {
282283
const comp = props.comp;
283284
const childrenProps = childrenToProps(comp.children);
285+
const childrenJsonProps = comp.toJsonValue();
284286
const parentDisabled = useContext(DisabledContext);
285287
const disabled = childrenProps['disabled'];
286288
if (disabled !== undefined && typeof disabled === 'boolean') {
@@ -296,6 +298,11 @@ function UIView(props: {
296298
}
297299
//END ADD BY FRED
298300

301+
useMergeCompStyles(
302+
childrenJsonProps as Record<string, any>,
303+
comp.dispatch
304+
);
305+
299306
// render condition for modal and drawer as we are not getting compType here
300307
if (comp.children.hasOwnProperty('showMask') && comp.children.hasOwnProperty('maskClosable')) {
301308
return (

client/packages/lowcoder/src/pages/setting/theme/ThemeCompPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ export const ThemeCompPanel = (props: any) => {
199199

200200
if (newComp) {
201201
const compChildrens = newComp.children;
202-
let styleChildrenKeys = Object.keys(compChildrens).filter(child => child.toLowerCase().endsWith('style'));
202+
let styleChildrenKeys = Object.keys(compChildrens).filter(child => child.toLowerCase().endsWith('style' || 'styles'));
203203
let styleChildrens: Record<string, any> = {};
204204
styleChildrenKeys.forEach((childKey: string) => {
205205
styleChildrens[childKey] = compChildrens[childKey];
206206
})
207207
if (compChildrens.container) {
208-
styleChildrenKeys = Object.keys(compChildrens.container.children).filter(child => child.toLowerCase().endsWith('style'));
208+
styleChildrenKeys = Object.keys(compChildrens.container.children).filter(child => child.toLowerCase().endsWith('style' || 'styles'));
209209
styleChildrenKeys.forEach((childKey: string) => {
210210
styleChildrens[childKey] = compChildrens.container.children[childKey];
211211
})

0 commit comments

Comments
 (0)