bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 90/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- angular, ios, typescript
Direzione di ricerca
Inizia da core/src/components/input-otp/input-otp.tsx ed esamina il ramo della casella vuota di onKeyDown e il ramo di inserimento e spostamento di onInput. Riproduci il problema con la demo Basic Usage su un iPhone inserendo tre cifre e premendo Backspace. La correzione è completata quando Backspace in una casella vuota cancella il valore precedente e la digitazione in una casella piena ne sostituisce il valore senza spostare le cifre rimanenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 52.7k
- Fork
- 13.3k
- Merge medio
- 2g 21h
- PR unite (30g)
- 65
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ionic-team/ionic-framework
-
bug: vue swipe cancellation throws when the previous page is missingForse già presa @dandoingdev l’ha presa 33 giorni fa. Apertapackage: vue type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ionic-team/ionic-framework#31514 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwardedForse già presa @HappyKnuckles l’ha presa 28 giorni fa. Apertaa11y package: core type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ionic-team/ionic-framework#31492 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: IonTabs throws when a Fragment contains one IonRouterOutletForse già presa @Benziza l’ha presa 69 giorni fa. Apertapackage: react type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ionic-team/ionic-framework#31410 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
package: angular type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
ionic-team/ionic-framework#31291 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't workForse già presa @RaphaelFakhri l’ha presa 10 giorni fa. Apertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
ionic-team/ionic-framework#30738 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ionic-team/ionic-framework
Issue simili
-
Phone app shows Unknown for a remote machine whose key changedForse già presa @janicduplessis l’ha presa oggi. Apertaarea: mobile priority: P3 type: bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
appandflow/stim#5006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Area - Local to Cloud Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/vscode-mssql#23209 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
code-yeongyu/senpi#5713 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
A-linter
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
oxc-project/oxc#28783 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
lingdojo/kana-dojo#33553 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno