@@ -2,6 +2,7 @@ import * as React from 'react';
22import { makeStyles } from '@material-ui/core/styles' ;
33import Grid from '@material-ui/core/Grid' ;
44import Typography from '@material-ui/core/Typography' ;
5+ import Box from '@material-ui/core/Box' ;
56import IconButton from '@material-ui/core/IconButton' ;
67import TreeItem from '@material-ui/lab/TreeItem' ;
78import Visibility from '@material-ui/icons/Visibility' ;
@@ -71,7 +72,7 @@ const ControlPanelTreeItem = (props) => {
7172 container
7273 className = { classes . networkItem }
7374 onMouseEnter = { ( ) => setIsHoveredOver ( true ) }
74- onMouseLeave = { ( ) => { setIsHoveredOver ( false ) ; setShowColorPicker ( false ) ; } }
75+ onMouseLeave = { ( ) => setIsHoveredOver ( false ) }
7576 display = "flex"
7677 flexDirection = "row"
7778 justifyContent = "space-between"
@@ -85,15 +86,19 @@ const ControlPanelTreeItem = (props) => {
8586
8687 < IconButton onClick = { ( event ) => onVisibilityClick ( event , nodeId ) } > < Visibility /> </ IconButton >
8788 < IconButton onClick = { generateRandomColor } > < Shuffle /> </ IconButton >
88- < IconButton onClick = { ( ) => setShowColorPicker ( ! showColorPicker ) } > < ColorLens /> </ IconButton >
89+ < IconButton onClick = { ( ) => setShowColorPicker ( true ) } > < ColorLens /> </ IconButton >
8990 {
9091 showColorPicker
9192 ? (
92- < ChromePicker
93- className = { classes . colorPicker }
94- color = { color }
95- onChangeComplete = { ( color ) => handleColorSelection ( color , nodeId ) }
96- />
93+ < Box
94+ onMouseLeave = { ( ) => setShowColorPicker ( false ) }
95+ >
96+ < ChromePicker
97+ className = { classes . colorPicker }
98+ color = { color }
99+ onChangeComplete = { ( color ) => handleColorSelection ( color , nodeId ) }
100+ />
101+ </ Box >
97102 ) : null
98103 }
99104
0 commit comments