mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 23:47:12 +02:00
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
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user