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:
Debanjum Singh Solanky 2024-10-22 21:20:22 -07:00
parent a134cd835c
commit 2a50694089

View file

@ -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();