Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/workshop-frontend/src/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,8 @@ export const ChatInput = ({
slashCommandPicker.dismiss();
return;
}
if (slashCommandPicker.open && e.key === "Enter" && !e.shiftKey) {
if (slashCommandPicker.open && e.key === "Enter" && !e.shiftKey &&
!e.nativeEvent.isComposing) {
e.preventDefault();
if (slashCommandPicker.selectable && slashCommandPicker.activeChoice) {
slashCommandPicker.select(slashCommandPicker.activeChoice);
Expand Down Expand Up @@ -3223,8 +3224,9 @@ export const ChatInput = ({
return;
}
}
// Enter sends message (unless Shift is held)
if (e.key === "Enter" && !e.shiftKey) {
// Enter sends message (unless Shift is held or an IME
// composition is in progress)
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault();
if (!isAgentActive && !isBlocked) submitMessage();
return;
Expand Down Expand Up @@ -6538,7 +6540,7 @@ function ChatInterface({
onChange={(e) => setRenamingInput(e.target.value)}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => {
if (e.key === "Enter") {
if (e.key === "Enter" && !e.nativeEvent.isComposing) {
e.preventDefault();
handleSaveListRename(chat.id);
} else if (e.key === "Escape") {
Expand Down
Loading