bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box
Los mantenedores suelen responder en 1 día
@sarankumar1325 ya está trabajando en esto.
Desde el 24/10/2026.
- #31651 de @sarankumar1325 — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 90/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- angular, ios, typescript
Línea de trabajo
Comienza en core/src/components/input-otp/input-otp.tsx y examina la rama de cuadro vacío de onKeyDown y la rama de inserción y desplazamiento de onInput. Reproduce el problema con la demo Basic Usage en un iPhone introduce tres dígitos y pulsa Backspace. La corrección estará completa cuando Backspace en un cuadro vacío borre el valor anterior y al escribir en un cuadro lleno se sustituya su valor sin desplazar los dígitos restantes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v9.x (9.0.8, same code on main)
Current Behavior
Happens on iOS (Safari and Capacitor app, on-screen keyboard), not every time. Not reproducible in desktop browsers.
Backspace in an empty box only moves focus to the previous box without clearing it. Since focus moves to the next empty box after each typed character, the first Backspace after typing can end up deleting nothing.
Typing into the now-focused, filled box then inserts the character and shifts the rest right instead of replacing it.
Expected Behavior
Per the docs:
- Backspace: "In an empty box: moves focus back one box and clears its value."
- Typing: "If the current box has a value, override the value with the entered character."
Steps to Reproduce
- On an iPhone, in the Basic Usage demo, type
789(focus is now on box 4) - Press Backspace: focus moves to box 3,
9stays - Type
6: the result is7869instead of786
May take a few tries; it does not happen on every attempt.
Code Reproduction URL
https://ionicframework.com/docs/api/input-otp#basic-usage
Ionic Info
@ionic/core 9.0.8, @ionic/angular 9.0.8, @angular/core 22.2.3, @capacitor/core 8.5.3
Additional Information
The empty-box branch of onKeyDown in core/src/components/input-otp/input-otp.tsx only calls this.focusPrevious(index). It should also clear inputValues[index - 1] and its input ref, call updateValue(event), and preventDefault(). The insert-and-shift branch of onInput contradicts the documented override behavior.
- Lenguaje dominante
- TypeScript
- Estrellas
- 52.7k
- Forks
- 13.3k
- Merge medio
- 3 d 4 h
- PR fusionados (30 d)
- 72
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 ionic-team/ionic-framework
-
bug: vue swipe cancellation throws when the previous page is missingPosiblemente ocupada @dandoingdev la tomó hace 32 días. Abiertopackage: vue type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ionic-team/ionic-framework#31514 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwardedPosiblemente ocupada @HappyKnuckles la tomó hace 27 días. Abiertoa11y package: core type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ionic-team/ionic-framework#31492 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug: IonTabs throws when a Fragment contains one IonRouterOutletPosiblemente ocupada @Benziza la tomó hace 68 días. Abiertopackage: react type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ionic-team/ionic-framework#31410 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
package: angular type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
ionic-team/ionic-framework#31291 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't workPosiblemente ocupada @RaphaelFakhri la tomó hace 9 días. Abiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
ionic-team/ionic-framework#30738 ·
Los mantenedores suelen responder en 1 día
Todos los issues de ionic-team/ionic-framework
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
LucasSantana-Dev/Lucky#2951 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
danielmiessler/LifeOS#2567 ·
Los mantenedores suelen responder en 9 días
-
refactor(react-pi): classify base64 images with core's parseBase64Posiblemente ocupada @jimmyallinai la tomó hoy. Abiertomaintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
assistant-ui/assistant-ui#10293 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
brijeshb42/monaco-vim#175 ·