Skip to content

Commit cd948af

Browse files
fixed table not loading inside kanban card
1 parent bf383d2 commit cd948af

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

client/packages/lowcoder/src/comps/controls/slotControl.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { createContext, useContext } from "react";
1616
import styled from "styled-components";
1717
import { NameGenerator } from "comps/utils";
1818
import { JSONValue } from "util/jsonTypes";
19+
import React from "react";
20+
import { isEqual } from "lodash";
1921

2022
const ModalStyled = styled.div<{ $background?: string }>`
2123
.ant-modal-content {
@@ -42,23 +44,23 @@ export const SlotConfigContext = createContext<{
4244
modalWidth: 520,
4345
});
4446

45-
const ContainerView = (props: ContainerBaseProps) => {
47+
const ContainerView = React.memo((props: ContainerBaseProps) => {
4648
return <InnerGrid {...props} emptyRows={15} autoHeight />;
47-
};
49+
});
4850

49-
function ModalConfigView(props: {
51+
const ModalConfigView = React.memo((props: {
5052
visible: boolean;
5153
containerProps: ConstructorToView<typeof SimpleContainerComp>;
5254
onCancel: () => void;
53-
}) {
55+
}) => {
5456
const { visible, containerProps, onCancel } = props;
5557
const background = useContext(BackgroundColorContext);
5658
const { modalWidth = 520 } = useContext(SlotConfigContext);
5759
if (!visible) {
5860
return null;
5961
}
6062
return (
61-
(<ModalWrapper>
63+
<ModalWrapper>
6264
<Modal
6365
width={modalWidth}
6466
open={visible}
@@ -67,6 +69,7 @@ function ModalConfigView(props: {
6769
footer={null}
6870
styles={{ body: {padding: "0"} }}
6971
zIndex={Layers.modal}
72+
maskClosable={false}
7073
modalRender={(node) => (
7174
<ModalStyled $background={background} onClick={() => {}}>
7275
{node}
@@ -81,9 +84,9 @@ function ModalConfigView(props: {
8184
items={gridItemCompToGridItems(containerProps.items)}
8285
/>
8386
</Modal>
84-
</ModalWrapper>)
87+
</ModalWrapper>
8588
);
86-
}
89+
}, (prevProps, nextProps) => isEqual(prevProps, nextProps));
8790

8891
const childrenMap = {
8992
container: SimpleContainerComp,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
8787
|| isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
8888
|| isCustomAction<ModuleReadyAction>(action, "moduleReady")
8989
) && action.path[1] === SELECTED_KEY) {
90+
if (action.path[0] === MAP_KEY && action.path[1] === SELECTED_KEY) {
91+
action.path[1] = this.selection;
92+
comp = super.reduce(action);
93+
}
9094
// broadcast
9195
const newAction = {
9296
...action,

0 commit comments

Comments
 (0)