From ebac0db0df4f73e384936fe359db08b1847da455 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Aug 2021 10:29:28 +0530 Subject: [PATCH] EmojiBoard bug fixed --- src/app/organisms/emoji-board/EmojiBoardOpener.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/organisms/emoji-board/EmojiBoardOpener.jsx b/src/app/organisms/emoji-board/EmojiBoardOpener.jsx index c9b81e9..a832832 100644 --- a/src/app/organisms/emoji-board/EmojiBoardOpener.jsx +++ b/src/app/organisms/emoji-board/EmojiBoardOpener.jsx @@ -7,12 +7,12 @@ import ContextMenu from '../../atoms/context-menu/ContextMenu'; import EmojiBoard from './EmojiBoard'; let requestCallback = null; +let isEmojiBoardVisible = false; function EmojiBoardOpener() { const openerRef = useRef(null); function openEmojiBoard(cords, requestEmojiCallback) { - console.log(requestCallback); - if (requestCallback !== null) { + if (requestCallback !== null || isEmojiBoardVisible) { requestCallback = null; if (cords.detail === 0) openerRef.current.click(); return; @@ -30,10 +30,10 @@ function EmojiBoardOpener() { } function afterEmojiBoardToggle(isVisible) { - console.log(isVisible); + isEmojiBoardVisible = isVisible; if (!isVisible) { setTimeout(() => { - requestCallback = null; + if (!isEmojiBoardVisible) requestCallback = null; }, 500); } } @@ -55,7 +55,7 @@ function EmojiBoardOpener() { )} afterToggle={afterEmojiBoardToggle} - render={(toggleMenu, isVisible) => ( + render={(toggleMenu) => (