Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit a93a285

Browse files
committed
Add minimun styling to hide menu
1 parent f16ce5b commit a93a285

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ContextMenu.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ export default class ContextMenu extends Component {
3737
wrapper(() => {
3838
this.menu.style.top = `${top}px`;
3939
this.menu.style.left = `${left}px`;
40+
this.menu.style.opacity = 1;
41+
this.menu.style.pointerEvents = 'auto';
4042
this.menu.classList.add(cssClasses.menuVisible);
4143
});
4244
});
4345
} else {
46+
this.menu.style.opacity = 0;
47+
this.menu.style.pointerEvents = 'none';
4448
this.menu.classList.remove(cssClasses.menuVisible);
4549
}
4650
}
@@ -124,7 +128,7 @@ export default class ContextMenu extends Component {
124128
render() {
125129
const { children } = this.props;
126130
const { top, left } = this.state;
127-
const style = {position: 'fixed', top, left};
131+
const style = {position: 'fixed', top, left, opacity: 0, pointerEvents: 'none'};
128132

129133
return (
130134
<nav ref={this.menuRef} style={style} className={cssClasses.menu}

0 commit comments

Comments
 (0)