only override contextmenu if closeMenu is provided

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2018-06-20 18:03:15 +01:00
parent 7cd8a5a2b2
commit 4508da5666
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E
1 changed files with 14 additions and 13 deletions

View File

@ -91,7 +91,7 @@ export default class ContextualMenu extends React.Component {
onContextMenu(e) {
if (this.props.closeMenu) {
this.props.closeMenu();
}
e.preventDefault();
const x = e.clientX;
const y = e.clientY;
@ -106,6 +106,7 @@ export default class ContextualMenu extends React.Component {
document.elementFromPoint(x, y).dispatchEvent(clickEvent);
});
}
}
render() {
const position = {};