-
-
Notifications
You must be signed in to change notification settings - Fork 240
feat: change send message from Enter to Shift+Enter #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,7 +365,7 @@ watch( | |
| type="text" | ||
| :placeholder="t('chat.typeAMessage')" | ||
| class="h-10 w-full border-transparent bg-transparent pl-14 pr-14 text-base text-foreground shadow-none transition-all md:h-14 placeholder:text-foreground/45 focus-visible:ring-0" | ||
| @keyup.enter="sendMessage" | ||
| @keyup.shift.enter="sendMessage" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent send shortcut between chat pagesMedium Severity This change makes the regular chat page use Shift+Enter to send, while |
||
| /> | ||
| <div class="absolute right-2 flex items-center gap-1"> | ||
| <Button | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change maps
Shift+Enterto send a message, which is a common pattern to allow for multi-line messages. However, the component used here is an<input type="text">, which does not support multi-line input.As a result, pressing
Enteralone now does nothing, and the user cannot create new lines. This creates a confusing user experience where a common key has no effect.To properly support multi-line messages, you should use a
<textarea>instead of an<input type="text">. With a<textarea>,Enterwould create a new line, andShift+Entercould send the message. I'd also recommend using the@keydownevent with the.preventmodifier to avoid inserting a newline character when sending the message.