bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 90/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- angular, ios, typescript
Piste de recherche
Commence dans core/src/components/input-otp/input-otp.tsx et examine la branche de case vide de onKeyDown ainsi que la branche d’insertion et de décalage de onInput. Reproduis le problème avec la démo Basic Usage sur un iPhone en saisissant trois chiffres et en appuyant sur Backspace. La correction est terminée lorsque Backspace dans une case vide efface la valeur précédente et que la saisie dans une case pleine remplace sa valeur sans décaler les chiffres restants.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 52.7k
- Forks
- 13.3k
- Merge moyen
- 3 j 4 h
- PR mergées (30 j)
- 72
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ionic-team/ionic-framework
-
bug: vue swipe cancellation throws when the previous page is missingPeut-être pris @dandoingdev l’a pris il y a 32 jours. Ouvertepackage: vue type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
ionic-team/ionic-framework#31514 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwardedPeut-être pris @HappyKnuckles l’a pris il y a 27 jours. Ouvertea11y package: core type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
ionic-team/ionic-framework#31492 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug: IonTabs throws when a Fragment contains one IonRouterOutletPeut-être pris @Benziza l’a pris il y a 68 jours. Ouvertepackage: react type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ionic-team/ionic-framework#31410 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
package: angular type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
ionic-team/ionic-framework#31291 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't workPeut-être pris @RaphaelFakhri l’a pris il y a 9 jours. Ouvertetriage
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
ionic-team/ionic-framework#30738 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de ionic-team/ionic-framework
Issues similaires
-
area: cli bug flake ready-for-agent
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
gazetta-studio/gazetta-studio#1772 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
microsoft/playwright#43875 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
README translations: ja, ko, deOuvertedocumentation good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
feature
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
calagopus/panel#285 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour