From 7fae92865a3212b2725157dc86144ce8a211b234 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 16 Mar 2021 10:49:37 +0300 Subject: [PATCH] Refactor #1875 - For ContextMenu --- src/components/contextmenu/ContextMenu.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/contextmenu/ContextMenu.js b/src/components/contextmenu/ContextMenu.js index ba59e5c617..027eb5957c 100644 --- a/src/components/contextmenu/ContextMenu.js +++ b/src/components/contextmenu/ContextMenu.js @@ -469,9 +469,6 @@ export class ContextMenu extends Component { render() { const element = this.renderContextMenu(); - if (this.props.appendTo) - return ReactDOM.createPortal(element, this.props.appendTo); - else - return element; + return ReactDOM.createPortal(element, this.props.appendTo || document.body); } }