nowarp for explore item title

This commit is contained in:
codetypes committed 2024-05-03 23:07:35 +08:00
1 parent 024f36a151
commit 06f9665d6d
3 files changed
+38 -8

No files matched your search

+26 -1
View File
@@ -804,7 +804,19 @@ export const Explorer: FC = () => {
</div>
);
} else {
return <span key={node.path}>{node.title}</span>;
return (
<div style={{ flex: 1, width: 0, minWidth: 0 }}>
<div
style={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{node.title}
</div>
</div>
);
}
}}
allowDrop={(options) => {
@@ -826,6 +838,19 @@ export const Explorer: FC = () => {
fieldNames={{ key: "title" }}
treeData={nodeTree ? [nodeTree] : []}
draggable={{ icon: false, nodeDraggable: (node) => !!node.isLeaf }}
titleRender={(node) => (
<div style={{ flex: 1, width: 0, minWidth: 0 }}>
<div
style={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{node.title}
</div>
</div>
)}
onSelect={(_, info) => {
const node = info.node;
if (node && node.isLeaf) {