[WIKI-577] fix: unexpected emoji input (#7534)
* fix: unexpected emoji input * update array
This commit is contained in:
parent
784b8da9be
commit
8cc513ba5e
1 changed files with 4 additions and 1 deletions
|
|
@ -61,6 +61,9 @@ export const EmojiList = forwardRef<EmojiListRef, EmojiListProps>((props, ref) =
|
|||
|
||||
const handleKeyDown = useCallback(
|
||||
(event: KeyboardEvent): boolean => {
|
||||
if (query.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
@ -86,7 +89,7 @@ export const EmojiList = forwardRef<EmojiListRef, EmojiListProps>((props, ref) =
|
|||
|
||||
return false;
|
||||
},
|
||||
[items.length, selectedIndex, selectItem]
|
||||
[query.length, items.length, selectItem, selectedIndex]
|
||||
);
|
||||
|
||||
// Update position when items change
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue