We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8299a0 commit bf11b90Copy full SHA for bf11b90
src/ContextMenu.js
@@ -59,9 +59,8 @@ export default class ContextMenu extends AbstractMenu {
59
}
60
61
componentDidUpdate() {
62
+ const wrapper = window.requestAnimationFrame || setTimeout;
63
if (this.state.isVisible) {
- const wrapper = window.requestAnimationFrame || setTimeout;
64
-
65
wrapper(() => {
66
const { x, y } = this.state;
67
@@ -78,9 +77,11 @@ export default class ContextMenu extends AbstractMenu {
78
77
});
79
80
} else {
81
- if (!this.menu || !this.state.isVisible) return;
82
- this.menu.style.opacity = 0;
83
- this.menu.style.pointerEvents = 'none';
+ wrapper(() => {
+ if (!this.menu) return;
+ this.menu.style.opacity = 0;
+ this.menu.style.pointerEvents = 'none';
84
+ });
85
86
87
0 commit comments