diff --git a/apps/common/mobile/lib/controller/ContextMenu.jsx b/apps/common/mobile/lib/controller/ContextMenu.jsx index 6421d7ab04..5f04946639 100644 --- a/apps/common/mobile/lib/controller/ContextMenu.jsx +++ b/apps/common/mobile/lib/controller/ContextMenu.jsx @@ -107,12 +107,11 @@ class ContextMenuController extends Component { const subNav = document.querySelector('.subnavbar'); const rect = subNav.getBoundingClientRect(); - this.setState({ - items: this.initMenuItems(), - extraItems: this.initExtraItems() - }); + const items = this.initMenuItems(); + const extraItems = this.initExtraItems(); + this.setState({ items, extraItems }); - if ( this.state.items.length > 0 ) { + if ( items.length > 0 ) { const api = Common.EditorApi.get(); this.$targetEl.css({left: `${x}px`, top: y < rect.bottom ? `${rect.bottom}px` : `${y}px`}); diff --git a/apps/common/mobile/lib/view/ContextMenu.jsx b/apps/common/mobile/lib/view/ContextMenu.jsx index 2f494c59ba..08803a9676 100644 --- a/apps/common/mobile/lib/view/ContextMenu.jsx +++ b/apps/common/mobile/lib/view/ContextMenu.jsx @@ -21,6 +21,7 @@ class ContextMenuView extends Component { return (