11import * as React from 'react' ;
22import { makeStyles } from '@material-ui/core/styles' ;
3- import Box from '@material-ui/core/Box' ;
43import Grid from '@material-ui/core/Grid' ;
54import Typography from '@material-ui/core/Typography' ;
65import IconButton from '@material-ui/core/IconButton' ;
@@ -39,7 +38,7 @@ const ControlPanelTreeItem = (props) => {
3938 const [ isHoveredOver , setIsHoveredOver ] = React . useState ( false ) ;
4039 const [ color , setColor ] = React . useState ( '#ff0000' ) ;
4140
42- const handleColorSelection = ( color , event , nodeId ) => {
41+ const handleColorSelection = ( color , nodeId ) => {
4342 setColor ( color . hex ) ;
4443 } ;
4544
@@ -66,6 +65,7 @@ const ControlPanelTreeItem = (props) => {
6665 return (
6766 < TreeItem
6867 nodeId = { nodeId }
68+ onLabelClick = { ( e ) => { e . stopPropagation ( ) ; e . preventDefault ( ) ; } }
6969 label = { (
7070 < Grid
7171 container
@@ -76,7 +76,7 @@ const ControlPanelTreeItem = (props) => {
7676 flexDirection = "row"
7777 justifyContent = "space-between"
7878 >
79- < Grid item xs = { 4 } > < Typography onClick = { ( event ) => onNodeSelect ( event , nodeId ) } > { label } </ Typography > </ Grid >
79+ < Grid item xs = { 4 } > < Typography onClick = { ( ) => onNodeSelect ( nodeId ) } > { label } </ Typography > </ Grid >
8080 < Grid item xs = { 4 } justifyContent = "center" > < Typography > { type } </ Typography > </ Grid >
8181 < Grid item xs = { 4 } justifyContent = "flex-end" className = { classes . controls } >
8282 { isHoveredOver
@@ -92,7 +92,7 @@ const ControlPanelTreeItem = (props) => {
9292 < ChromePicker
9393 className = { classes . colorPicker }
9494 color = { color }
95- onChangeComplete = { ( e , color ) => handleColorSelection ( e , color , nodeId ) }
95+ onChangeComplete = { ( color ) => handleColorSelection ( color , nodeId ) }
9696 />
9797 ) : null
9898 }
0 commit comments