Ensure that one emoji is added, when expected

This commit is contained in:
Scott Nonnenberg 2022-09-15 16:15:56 -07:00 committed by GitHub
parent b290b577d4
commit c6819a5438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -146,12 +146,9 @@ export const StoryViewsNRepliesModal = ({
const insertEmoji = useCallback(
(e: EmojiPickDataType) => {
if (inputApiRef.current) {
inputApiRef.current.insertEmoji(e);
onUseEmoji(e);
}
},
[inputApiRef, onUseEmoji]
[onUseEmoji]
);
const [referenceElement, setReferenceElement] =

View file

@ -152,8 +152,7 @@ export const EmojiPicker = React.memo(
doSend();
e.stopPropagation();
e.preventDefault();
}
if (shortName) {
} else if (shortName) {
onPickEmoji({ skinTone: selectedTone, shortName });
e.stopPropagation();
e.preventDefault();