mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Allow typing multi-line queries from a phone with Enter key
Add newline instead of sending message when hit Enter key on mobile displays. As on phones shift key doesn't exist and send button is easily clickable. Limit hitting Enter key to send message to computers = larger display = expected to have full fledged keyboards.
This commit is contained in:
parent
a134cd835c
commit
2a50694089
1 changed files with 1 additions and 1 deletions
|
@ -460,7 +460,7 @@ export const ChatInputArea = forwardRef<HTMLTextAreaElement, ChatInputProps>((pr
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
value={message}
|
value={message}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter" && !e.shiftKey) {
|
if (e.key === "Enter" && !e.shiftKey && !props.isMobileWidth) {
|
||||||
setImageUploaded(false);
|
setImageUploaded(false);
|
||||||
setImagePaths([]);
|
setImagePaths([]);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Reference in a new issue