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 @@ -135,6 +135,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
135
135
}
136
136
} }
137
137
{ ...( ( hasCheckbox || isSelectable ) && { 'aria-labelledby' : `label-${ randomId } ` } ) }
138
+ { ...( ToggleComponent === 'button' && { type : 'button' } ) }
138
139
tabIndex = { - 1 }
139
140
>
140
141
< span className = { css ( styles . treeViewNodeToggleIcon ) } >
@@ -167,7 +168,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
167
168
< >
168
169
{ isCompact && title && < span className = { css ( styles . treeViewNodeTitle ) } > { title } </ span > }
169
170
{ isSelectable ? (
170
- < button tabIndex = { - 1 } className = { css ( styles . treeViewNodeText ) } >
171
+ < button tabIndex = { - 1 } className = { css ( styles . treeViewNodeText ) } type = "button" >
171
172
{ name }
172
173
</ button >
173
174
) : (
@@ -230,6 +231,7 @@ const TreeViewListItemBase: React.FunctionComponent<TreeViewListItemProps> = ({
230
231
} }
231
232
{ ...( hasCheckbox && { htmlFor : randomId } ) }
232
233
{ ...( ( hasCheckbox || ( isSelectable && children ) ) && { id : `label-${ randomId } ` } ) }
234
+ { ...( Component === 'button' && { type : 'button' } ) }
233
235
>
234
236
< span className = { css ( styles . treeViewNodeContainer ) } >
235
237
{ children && renderToggle ( randomId ) }
You can’t perform that action at this time.
0 commit comments