From 4e12131d7c5dbd073e2d2f3a90159f44df1d1a5c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 11:27:19 +0000 Subject: [PATCH] feat(editor): add Tab key support for autocomplete selection Tab now selects the currently highlighted item in all suggestion lists: - EmojiSuggestionList (`:emoji` autocomplete) - ProfileSuggestionList (`@mention` autocomplete) - SlashCommandSuggestionList (`/command` autocomplete) This is a common UX pattern that allows faster selection without reaching for the Enter key. https://claude.ai/code/session_01YWNAEhjLprna1iWcnQEr1o --- src/components/editor/EmojiSuggestionList.tsx | 5 ++++- src/components/editor/ProfileSuggestionList.tsx | 5 ++++- src/components/editor/SlashCommandSuggestionList.tsx | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/editor/EmojiSuggestionList.tsx b/src/components/editor/EmojiSuggestionList.tsx index 8d1a36f..28b8f2f 100644 --- a/src/components/editor/EmojiSuggestionList.tsx +++ b/src/components/editor/EmojiSuggestionList.tsx @@ -58,7 +58,10 @@ export const EmojiSuggestionList = forwardRef< return true; } - if (event.key === "Enter" && !event.ctrlKey && !event.metaKey) { + if ( + (event.key === "Enter" && !event.ctrlKey && !event.metaKey) || + event.key === "Tab" + ) { if (items[selectedIndex]) { command(items[selectedIndex]); } diff --git a/src/components/editor/ProfileSuggestionList.tsx b/src/components/editor/ProfileSuggestionList.tsx index 0be7b74..7efab32 100644 --- a/src/components/editor/ProfileSuggestionList.tsx +++ b/src/components/editor/ProfileSuggestionList.tsx @@ -38,7 +38,10 @@ export const ProfileSuggestionList = forwardRef< return true; } - if (event.key === "Enter" && !event.ctrlKey && !event.metaKey) { + if ( + (event.key === "Enter" && !event.ctrlKey && !event.metaKey) || + event.key === "Tab" + ) { if (items[selectedIndex]) { command(items[selectedIndex]); } diff --git a/src/components/editor/SlashCommandSuggestionList.tsx b/src/components/editor/SlashCommandSuggestionList.tsx index eb8e28d..671e3f3 100644 --- a/src/components/editor/SlashCommandSuggestionList.tsx +++ b/src/components/editor/SlashCommandSuggestionList.tsx @@ -38,7 +38,10 @@ export const SlashCommandSuggestionList = forwardRef< return true; } - if (event.key === "Enter" && !event.ctrlKey && !event.metaKey) { + if ( + (event.key === "Enter" && !event.ctrlKey && !event.metaKey) || + event.key === "Tab" + ) { if (items[selectedIndex]) { command(items[selectedIndex]); }