Skip to content

Commit 501e00d

Browse files
fix: fixed popover and collapse
1 parent 4d93ea2 commit 501e00d

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

client/packages/lowcoder-design/src/components/Collapase.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Collapse as AntdCollapse } from "antd";
1+
import { Collapse as AntdCollapse, CollapseProps } from "antd";
22
import { ReactComponent as UnFold } from "icons/icon-unfold.svg";
33
import { ReactComponent as Folded } from "icons/icon-folded.svg";
44
import { ReactComponent as Omit } from "icons/icon-omit.svg";
@@ -98,6 +98,12 @@ export const Collapse = (props: Iprops) => {
9898
// setColor(keys.length ? "#F2F7FC" : "");
9999
// onChange && onChange(keys);
100100
// };
101+
const collapseItems:CollapseProps['items'] = config.map((item) => ({
102+
key: item.key,
103+
label: item.title,
104+
children: item.data,
105+
}))
106+
101107
return (
102108
// <Contain $color={props.isSelected || Color!==""}>
103109
<Container optColor={props.isSelected} simple={props.simple} className={props.className}>
@@ -106,19 +112,8 @@ export const Collapse = (props: Iprops) => {
106112
expandIcon={getExpandIcon}
107113
defaultActiveKey={props.isOpen ? [props.config[0].key] : []}
108114
// onChange={handlechange}
109-
>
110-
{config && config.length > 0
111-
? config.map((item, index) => {
112-
return (
113-
<React.Fragment key={index}>
114-
<Panel header={item.title} key={item.key} showArrow={true}>
115-
{item.data}
116-
</Panel>
117-
</React.Fragment>
118-
);
119-
})
120-
: null}
121-
</AntdCollapse>
115+
items={collapseItems}
116+
/>
122117
</Container>
123118
);
124119
};

client/packages/lowcoder-design/src/components/popover.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const CustomPopover = (props: {
9898
);
9999
return (
100100
<Popover
101+
overlayInnerStyle={{padding: 0}}
101102
content={contentWithBox}
102103
trigger="click"
103104
open={visible}

0 commit comments

Comments
 (0)