Skip to content

Commit 9ce52f5

Browse files
authored
Merge pull request #405 from MetaCell/bug/206
#206 Fix tooltip bug
2 parents cdce379 + 5414125 commit 9ce52f5

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

webapp/components/general/NetPyNEField.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import Utils from '../../Utils';
77
import { REAL_TYPE } from '../../constants';
88

99
export default class NetPyNEField extends Component {
10+
constructor (props) {
11+
super(props);
12+
this.state = { open: false };
13+
}
1014
setErrorMessage (value) {
1115
return new Promise((resolve, reject) => {
1216
if (this.realType === REAL_TYPE.FUNC) {
@@ -47,6 +51,10 @@ export default class NetPyNEField extends Component {
4751
return value;
4852
}
4953

54+
handleTooltip (action) {
55+
this.setState({ open: action});
56+
}
57+
5058
render () {
5159
const { id, children } = this.props;
5260

@@ -126,8 +134,12 @@ export default class NetPyNEField extends Component {
126134
leaveTouchDelay={0}
127135
disableTouchListener
128136
disableFocusListener
137+
open={this.state.open}
129138
>
130-
<Box mb={1} width="100%">
139+
<Box mb={1} width="100%"
140+
onMouseEnter= {() => { this.handleTooltip(true) }}
141+
onMouseLeave = { () => { this.handleTooltip(false) }}
142+
onClick={ () => { this.handleTooltip(false) }}>
131143
{childWithProp}
132144
</Box>
133145
</Tooltip>

0 commit comments

Comments
 (0)