diff --git a/packages/ui/src/components/prompt-input/usePromptVoiceInput.ts b/packages/ui/src/components/prompt-input/usePromptVoiceInput.ts index 6bcc8746..0ff87d07 100644 --- a/packages/ui/src/components/prompt-input/usePromptVoiceInput.ts +++ b/packages/ui/src/components/prompt-input/usePromptVoiceInput.ts @@ -176,7 +176,7 @@ export function usePromptVoiceInput(options: UsePromptVoiceInputOptions) { const before = current.slice(0, start) const after = current.slice(end) const prefix = "" - const suffix = after.length > 0 && !after.startsWith("\n") ? "\n" : "" + const suffix = after.length > 0 ? (/^\s/.test(after) ? "" : " ") : " " const nextValue = `${before}${prefix}${text}${suffix}${after}` const cursor = before.length + prefix.length + text.length + suffix.length