File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
packages/react/src/TreeView Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 6969 "name" : " onSelect" ,
7070 "type" : " (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void"
7171 },
72+ {
73+ "name" : " truncate" ,
74+ "type" : " boolean" ,
75+ "defaultValue" : " true" ,
76+ "description" : " Truncate the item's text content with an ellipsis."
77+ },
7278 {
7379 "name" : " ref" ,
7480 "type" : " React.Ref<HTMLElement>"
Original file line number Diff line number Diff line change @@ -1046,15 +1046,13 @@ export const LeadingAction: StoryFn = () => {
10461046
10471047export const MultilineItems : StoryFn = ( ) => (
10481048 < nav aria-label = "Files changed" >
1049- < TreeView aria-label = "Files changed" >
1049+ < TreeView aria-label = "Files changed" truncate = { false } >
10501050 < TreeView . Item id = "src" defaultExpanded >
10511051 < TreeView . LeadingVisual >
10521052 < TreeView . DirectoryIcon />
10531053 </ TreeView . LeadingVisual >
1054- < div style = { { whiteSpace : 'wrap' } } >
1055- this is a very long directory name that we have intentionally allowed to wrap over multiple lines to
1056- demonstrate alignment
1057- </ div >
1054+ this is a very long directory name that we have intentionally allowed to wrap over multiple lines to demonstrate
1055+ alignment
10581056 < TreeView . SubTree >
10591057 < TreeView . Item id = "src/Avatar.tsx" >
10601058 < TreeView . LeadingVisual >
@@ -1071,9 +1069,7 @@ export const MultilineItems: StoryFn = () => (
10711069 < TreeView . LeadingVisual >
10721070 < TreeView . DirectoryIcon />
10731071 </ TreeView . LeadingVisual >
1074- < div style = { { whiteSpace : 'wrap' } } >
1075- this is a medium directory name that we wrap over 2 lines to demonstrate alignment
1076- </ div >
1072+ this is a medium directory name that we wrap over 2 lines to demonstrate alignment
10771073 < TreeView . TrailingVisual label = "Added" >
10781074 < Octicon icon = { DiffAddedIcon } color = "success.fg" />
10791075 </ TreeView . TrailingVisual >
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ const Root: React.FC<TreeViewProps> = ({
285285 'aria-labelledby' : ariaLabelledby ,
286286 children,
287287 flat,
288- truncate,
288+ truncate = true ,
289289 className,
290290} ) => {
291291 const containerRef = React . useRef < HTMLUListElement > ( null )
You can’t perform that action at this time.
0 commit comments