Skip to content

Commit 297ae81

Browse files
committed
Fixed folder or content title overflow in module panel and applied it on bottomContent.
1 parent 9e5a05f commit 297ae81

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

client/packages/lowcoder/src/components/DraggableTree/DroppableMenuItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default function DraggableMenuItem(props: IDraggableMenuItemProps) {
103103
>
104104
<span style={{cursor: "default"}}></span>
105105
</DraggableItem>
106-
<div style={{flex: 1}}>
106+
<div style={{ flex: 1 , maxWidth: "calc(100% - 12px)" }}>
107107
{renderContent?.({
108108
node: item,
109109
isOver,

client/packages/lowcoder/src/pages/editor/bottom/BottomSidebar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ const HighlightBorder = styled.div<{ $active: boolean; $foldable: boolean; $leve
323323
max-width: 100%;
324324
flex: 1;
325325
display: flex;
326-
padding-left: ${(props) => props.$level * 20 + (props.$foldable ? 0 : 14)}px;
326+
padding-left: ${(props) => props.$level * 10 + (props.$foldable ? 0 : 14)}px;
327327
border-radius: 4px;
328328
border: 1px solid ${(props) => (props.$active ? BorderActiveColor : "transparent")};
329329
align-items: center;

client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const ItemWrapper = styled.div`
3838
}
3939
.module-container {
4040
display: flex;
41+
width: 195px;
4142
}
4243
.module-icon {
4344
margin-right: 4px;
@@ -167,6 +168,7 @@ interface ModuleItemProps {
167168
setSelectedType: (id: boolean) => void;
168169
resComp: NodeType;
169170
id: string;
171+
$level: number;
170172
}
171173

172174
function ModuleItem(props: ModuleItemProps) {
@@ -179,7 +181,8 @@ function ModuleItem(props: ModuleItemProps) {
179181
selectedType,
180182
setSelectedType,
181183
resComp,
182-
id
184+
id,
185+
$level,
183186
} = props;
184187
const dispatch = useDispatch();
185188
const type = resComp.isFolder;
@@ -243,8 +246,9 @@ function ModuleItem(props: ModuleItemProps) {
243246
>
244247
<div className="module-container" >
245248
<ModuleDocIcon className="module-icon"/>
246-
<div style={{flexGrow: 1, marginRight: "8px", width: "calc(100% - 62px)"}}>
247-
<EditText
249+
<div style={{ flexGrow: 1, maxWidth: 174 - $level*10 }}>
250+
<EditText
251+
style={{ width: "100%" }}
248252
text={meta.name}
249253
forceClickIcon={false}
250254
disabled={!isSelected || readOnly || isOverlay}
@@ -268,7 +272,7 @@ const HighlightBorder = styled.div<{ $active: boolean; $foldable: boolean; $leve
268272
max-width: 100%;
269273
flex: 1;
270274
display: flex;
271-
padding-left: ${(props) => props.$level * 20 + (props.$foldable ? 0 : 14)}px;
275+
padding-left: ${(props) => props.$level * 10 + (props.$foldable ? 0 : 14)}px;
272276
border-radius: 4px;
273277
border: 1px solid ${(props) => (props.$active ? BorderActiveColor : "transparent")};
274278
align-items: center;
@@ -479,7 +483,8 @@ function ModuleSidebarItem(props: ModuleSidebarItemProps) {
479483
selectedType={selectedType}
480484
setSelectedType={setSelectedType}
481485
resComp = {resComp}
482-
id = {id}
486+
id={id}
487+
$level={level}
483488
/>}
484489
{!readOnly && !isOverlay && (
485490
<EditPopover del={() => onDelete()}>

0 commit comments

Comments
 (0)