File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/material-ui-lab/src/TreeItem Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,7 @@ const TreeItem = React.forwardRef(function TreeItem(props, ref) {
189189
190190 const handleMouseDown = ( event ) => {
191191 if ( event . shiftKey || event . ctrlKey || event . metaKey ) {
192+ // Prevent text selection
192193 event . preventDefault ( ) ;
193194 }
194195
@@ -363,7 +364,12 @@ const TreeItem = React.forwardRef(function TreeItem(props, ref) {
363364 if ( multiSelect ) {
364365 ariaSelected = selected ;
365366 } else if ( selected ) {
366- // single-selection trees unset aria-selected
367+ /* single-selection trees unset aria-selected on un-selected items.
368+ *
369+ * If the tree does not support multiple selection, aria-selected
370+ * is set to true for the selected node and it is not present on any other node in the tree.
371+ * Source: https://www.w3.org/TR/wai-aria-practices/#TreeView
372+ */
367373 ariaSelected = true ;
368374 }
369375
You can’t perform that action at this time.
0 commit comments