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,
|
isActive: isOpen,
|
||||||
isHorizontal: true,
|
isHorizontal: true,
|
||||||
items: listEmojis,
|
items: listEmojis,
|
||||||
|
shouldRemoveSelectionOnReset: true,
|
||||||
onSelect: handleSelect,
|
onSelect: handleSelect,
|
||||||
onClose,
|
onClose,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -44,6 +44,8 @@ export function useKeyboardNavigation({
|
|||||||
const handleItemSelect = useLastCallback((e: KeyboardEvent) => {
|
const handleItemSelect = useLastCallback((e: KeyboardEvent) => {
|
||||||
// Prevent action on key combinations
|
// Prevent action on key combinations
|
||||||
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return false;
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return false;
|
||||||
|
if (!isActive) return false;
|
||||||
|
|
||||||
if (items && items.length && selectedItemIndex > -1) {
|
if (items && items.length && selectedItemIndex > -1) {
|
||||||
const item = items[selectedItemIndex];
|
const item = items[selectedItemIndex];
|
||||||
if (item) {
|
if (item) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user