fix crash on emoji selection from emojiboard (#2249)
* fix crash on emoji select * fix crash in message editor on emoji select
This commit is contained in:
@@ -600,8 +600,13 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
|||||||
onCustomEmojiSelect={handleEmoticonSelect}
|
onCustomEmojiSelect={handleEmoticonSelect}
|
||||||
onStickerSelect={handleStickerSelect}
|
onStickerSelect={handleStickerSelect}
|
||||||
requestClose={() => {
|
requestClose={() => {
|
||||||
setEmojiBoardTab(undefined);
|
setEmojiBoardTab((t) => {
|
||||||
if (!mobileOrTablet()) ReactEditor.focus(editor);
|
if (t) {
|
||||||
|
if (!mobileOrTablet()) ReactEditor.focus(editor);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return t;
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,8 +305,13 @@ export const MessageEditor = as<'div', MessageEditorProps>(
|
|||||||
onEmojiSelect={handleEmoticonSelect}
|
onEmojiSelect={handleEmoticonSelect}
|
||||||
onCustomEmojiSelect={handleEmoticonSelect}
|
onCustomEmojiSelect={handleEmoticonSelect}
|
||||||
requestClose={() => {
|
requestClose={() => {
|
||||||
setAnchor(undefined);
|
setAnchor((v) => {
|
||||||
if (!mobileOrTablet()) ReactEditor.focus(editor);
|
if (v) {
|
||||||
|
if (!mobileOrTablet()) ReactEditor.focus(editor);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user