PromptInput: successful async submit clears text typed while the submit was pending
Los mantenedores suelen responder en 1 día
@NicolasMilliard ya está trabajando en esto.
Desde el 19/10/2026.
- #522 de @NicolasMilliard — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
El error está en la ruta de envío del componente PromptInput y en el estado de PromptInputProvider, donde controller.textInput.clear() se ejecuta después de que se resuelve el onSubmit asíncrono. Empieza leyendo cómo el provider almacena la entrada de texto y cómo PromptInput llama a clear cuando tiene éxito. Está terminado cuando un borrador escrito durante un envío pendiente sobrevive a un envío exitoso, y una prueba cubre un onSubmit retrasado con el texto cambiado a mitad del proceso.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
With PromptInputProvider, an async onSubmit keeps the text until the promise resolves, which is good for retrying a failed send. But after it resolves, PromptInput calls controller.textInput.clear(), which clears the current draft, not the text that was submitted.
The textarea stays editable while the promise is pending. Anything typed during that time is erased when the send succeeds.
Reproduction
- Wrap
PromptInputinPromptInputProvider. - Use an
onSubmitthat resolves after a delay, e.g.await new Promise(r => setTimeout(r, 3000)). - Type "first" and press Enter.
- While the promise is pending, type " second" (or replace the text).
- When the promise resolves, the textarea is emptied and the newer text is lost.
Expected
Only clear the draft if it still equals the submitted text, e.g. a functional update in the provider:
setTextInput((current) => (current === submitted ? "" : current));
(Alternatively, disable the textarea while a submission is pending.)
Environment
prompt-input from the current registry (npx ai-elements@latest add prompt-input), React 19.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.5k
- Forks
- 291
- Merge medio
- 20 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel/ai-elements
-
Attachments: remove button stays invisible on keyboard focus and on touch screensPosiblemente ocupada @HardMax71 la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel/ai-elements#507 ·
Los mantenedores suelen responder en 1 día
-
ChainOfThought: the header's aria-controls points at an element that is never renderedPosiblemente ocupada @HardMax71 la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vercel/ai-elements#505 ·
Los mantenedores suelen responder en 1 día
-
PromptInput rejects every file when accept lists file extensions (".xlsx")Posiblemente ocupada @HardMax71 la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
vercel/ai-elements#501 ·
Los mantenedores suelen responder en 1 día
-
Context: ContextReasoningUsage and ContextCacheUsage don't compile with ai 7Posiblemente ocupada @burrows99 la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
vercel/ai-elements#500 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel/ai-elements#498 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel/ai-elements
Issues similares
-
area:plugins area:security area:skills bug has repro
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anthropics/claude-code#105911 ·
Los mantenedores suelen responder en 1 día
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Fission-AI/OpenSpec#2165 ·
Los mantenedores suelen responder en 1 día
-
🐞 bug 🧐 unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Tencent/tdesign-vue-next#7032 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
gnosis/gnosis_vpn#661 ·
Los mantenedores suelen responder en 1 día
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Abiertotriage:bug-verified
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día