mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
fix: Add a new line when press the Enter key on mobile. (#1450)
This commit is contained in:
parent
3c65d79a74
commit
93e4a04ef1
1 changed files with 8 additions and 4 deletions
|
|
@ -253,10 +253,14 @@ const ChatInput = forwardRef<{ focus: () => void }, ChatInputProps>(
|
|||
}
|
||||
|
||||
if (e.key === "Enter" && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
onSendMessage(false);
|
||||
setHistoryIndex(-1);
|
||||
setTempInput("");
|
||||
// Only prevent default and send message on non-mobile platforms
|
||||
if (!Platform.isMobile) {
|
||||
e.preventDefault();
|
||||
onSendMessage(false);
|
||||
setHistoryIndex(-1);
|
||||
setTempInput("");
|
||||
}
|
||||
// On mobile, do nothing here, allowing the default newline behavior
|
||||
} else if (e.key === "ArrowUp") {
|
||||
if (currentLineIndex > 0 || selectionStart > 0) {
|
||||
// Allow normal cursor movement within multi-line input
|
||||
|
|
|
|||
Loading…
Reference in a new issue