File tree Expand file tree Collapse file tree 2 files changed +63
-1
lines changed
packages/react-core/src/components/TreeView Expand file tree Collapse file tree 2 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
124124 }
125125 } }
126126 { ...( ( hasCheck || isSelectable ) && { 'aria-labelledby' : `label-${ randomId } ` } ) }
127+ { ...( ToggleComponent === 'button' && { type : 'button' } ) }
127128 tabIndex = { - 1 }
128129 >
129130 < span className = { css ( styles . treeViewNodeToggleIcon ) } >
@@ -156,7 +157,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
156157 < >
157158 { isCompact && title && < span className = { css ( styles . treeViewNodeTitle ) } > { title } </ span > }
158159 { isSelectable ? (
159- < button tabIndex = { - 1 } className = { css ( styles . treeViewNodeText ) } >
160+ < button tabIndex = { - 1 } className = { css ( styles . treeViewNodeText ) } type = "button" >
160161 { name }
161162 </ button >
162163 ) : (
@@ -214,6 +215,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
214215 } }
215216 { ...( hasCheck && { htmlFor : randomId } ) }
216217 { ...( ( hasCheck || ( isSelectable && children ) ) && { id : `label-${ randomId } ` } ) }
218+ { ...( Component === 'button' && { type : 'button' } ) }
217219 >
218220 < span className = { css ( styles . treeViewNodeContainer ) } >
219221 { children && renderToggle ( randomId ) }
You can’t perform that action at this time.
0 commit comments