feat(web): finish a dictation after 3 seconds of silence
Safari on iOS keeps listening long after the user stops talking, so the phrase only got added by pressing Enter (which added the raw transcript, skipping the AI split). Now the dictation ends 3 seconds after the last words heard and goes through the usual voice flow; Enter while listening ends it the same way instead of adding the text as typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -276,7 +276,14 @@ export function CreateItemForm({ listId, autoFocus = false }: CreateItemFormProp
|
||||
: 'Dictar productos'
|
||||
|
||||
return (
|
||||
<form onSubmit={onSubmit}>
|
||||
<form
|
||||
onSubmit={(event) => {
|
||||
// Enter while dictating ends the dictation: what was heard goes through its flow.
|
||||
if (!dictation.listening) return onSubmit(event)
|
||||
event.preventDefault()
|
||||
dictation.stop()
|
||||
}}
|
||||
>
|
||||
<Field data-invalid={!!form.formState.errors.name}>
|
||||
<InputGroup className="bg-card h-14 rounded-full shadow-xs dark:bg-card">
|
||||
<InputGroupAddon className="pl-1.5">
|
||||
|
||||
Reference in New Issue
Block a user