mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Fix emoji button bug
This commit is contained in:
@@ -66,7 +66,10 @@ export function ChatInputWrapper(
|
|||||||
setAttachmentsVisible(selectedFiles.length > 0);
|
setAttachmentsVisible(selectedFiles.length > 0);
|
||||||
}, [selectedFiles]);
|
}, [selectedFiles]);
|
||||||
|
|
||||||
function handleEmojiButtonClick() {
|
function handleEmojiButtonClick(e: React.MouseEvent<HTMLButtonElement>) {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
if (!emojiMenuOpen) {
|
||||||
if (chatInputWrapperRef.current && messagePanelRef?.current) {
|
if (chatInputWrapperRef.current && messagePanelRef?.current) {
|
||||||
const inputRect = chatInputWrapperRef.current.getBoundingClientRect();
|
const inputRect = chatInputWrapperRef.current.getBoundingClientRect();
|
||||||
const panelRect = messagePanelRef.current.getBoundingClientRect();
|
const panelRect = messagePanelRef.current.getBoundingClientRect();
|
||||||
@@ -79,6 +82,9 @@ export function ChatInputWrapper(
|
|||||||
});
|
});
|
||||||
setEmojiMenuOpen(true);
|
setEmojiMenuOpen(true);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setEmojiMenuOpen(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleEmojiSelect(emoji: string) {
|
function handleEmojiSelect(emoji: string) {
|
||||||
@@ -176,7 +182,12 @@ export function ChatInputWrapper(
|
|||||||
</AnimatedHeight>
|
</AnimatedHeight>
|
||||||
<div className="chat-input">
|
<div className="chat-input">
|
||||||
<div className="left-buttons">
|
<div className="left-buttons">
|
||||||
<mdui-button-icon icon="mood" onClick={handleEmojiButtonClick} className="emoji-btn"></mdui-button-icon>
|
<mdui-button-icon
|
||||||
|
icon="mood"
|
||||||
|
onClick={handleEmojiButtonClick}
|
||||||
|
onMouseDown={e => e.stopPropagation()}
|
||||||
|
onMouseUp={e => e.stopPropagation()}
|
||||||
|
className="emoji-btn" />
|
||||||
</div>
|
</div>
|
||||||
<RichTextArea
|
<RichTextArea
|
||||||
className="message-input"
|
className="message-input"
|
||||||
|
|||||||
Reference in New Issue
Block a user