Emoji Tooltip: Open without focus on the first emoji (#3366)
This commit is contained in:
parent
e82b6110ac
commit
10d4e6b9fa
@ -122,6 +122,7 @@ const EmojiTooltip: FC<OwnProps> = ({
|
||||
isActive: isOpen,
|
||||
isHorizontal: true,
|
||||
items: listEmojis,
|
||||
shouldRemoveSelectionOnReset: true,
|
||||
onSelect: handleSelect,
|
||||
onClose,
|
||||
});
|
||||
|
||||
@ -44,6 +44,8 @@ export function useKeyboardNavigation({
|
||||
const handleItemSelect = useLastCallback((e: KeyboardEvent) => {
|
||||
// Prevent action on key combinations
|
||||
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return false;
|
||||
if (!isActive) return false;
|
||||
|
||||
if (items && items.length && selectedItemIndex > -1) {
|
||||
const item = items[selectedItemIndex];
|
||||
if (item) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user