Skip to content

Commit de41656

Browse files
Revert "Revert "(TreeNode): update markups""
This reverts commit 4589d04.
1 parent 038b3bb commit de41656

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

src/scripts/TreeNode.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,37 @@ const TreeNodeItem: FC<TreeNodeProps & { icon?: string }> = (props) => {
8484
)}
8585
{!leaf ? (
8686
<Button
87-
className='slds-m-right_small'
87+
className='slds-m-right_x-small'
8888
aria-controls=''
8989
aria-hidden='true'
9090
tabIndex={-1}
9191
type='icon-bare'
9292
icon={icon}
93-
iconSize='small'
93+
iconSize='x-small'
9494
onClick={onToggle}
9595
title={typeof label === 'string' ? `Expand ${label}` : undefined}
9696
// Prevent focus loss during loading by keeping the toggle button in the DOM with opacity set to 0.
9797
style={loading ? { opacity: 0, pointerEvents: 'none' } : undefined}
9898
/>
9999
) : null}
100-
<a
101-
className='slds-truncate'
102-
tabIndex={-1}
103-
onClick={onLabelClick}
104-
>
105-
{ItemRender ? <ItemRender {...props} /> : label}
106-
</a>
100+
<span className='slds-has-flexi-truncate'>
101+
{onLabelClick ? (
102+
<a
103+
className='slds-tree__item-label slds-truncate'
104+
tabIndex={-1}
105+
onClick={onLabelClick}
106+
>
107+
{ItemRender ? <ItemRender {...props} /> : label}
108+
</a>
109+
) : (
110+
<span
111+
className='slds-tree__item-label slds-truncate'
112+
title={typeof label === 'string' ? label : undefined}
113+
>
114+
{ItemRender ? <ItemRender {...props} /> : label}
115+
</span>
116+
)}
117+
</span>
107118
{leaf ? children : null}
108119
</div>
109120
);

0 commit comments

Comments
 (0)