mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 15:36:53 +02:00
fix: allow Ctrl/Cmd+Enter to submit messages when suggestion popup is open
The suggestion list components were intercepting all Enter key presses, including Ctrl+Enter and Cmd+Enter, preventing message submission when the autocomplete popup was visible. Now these modifier combinations pass through to the editor's submit handler.
This commit is contained in:
@@ -58,7 +58,7 @@ export const EmojiSuggestionList = forwardRef<
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event.key === "Enter") {
|
||||
if (event.key === "Enter" && !event.ctrlKey && !event.metaKey) {
|
||||
if (items[selectedIndex]) {
|
||||
command(items[selectedIndex]);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export const ProfileSuggestionList = forwardRef<
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event.key === "Enter") {
|
||||
if (event.key === "Enter" && !event.ctrlKey && !event.metaKey) {
|
||||
if (items[selectedIndex]) {
|
||||
command(items[selectedIndex]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user