bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 90/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, ios, typescript
Rechercherichtung
Beginne in core/src/components/input-otp/input-otp.tsx und untersuche den Empty-Box-Zweig von onKeyDown sowie den Insert-and-Shift-Zweig von onInput. Reproduziere dies mit der Basic Usage-Demo auf einem iPhone, indem du drei Ziffern eingibst und Backspace drückst. Die Korrektur ist abgeschlossen, wenn Backspace in einem leeren Feld den vorherigen Wert löscht und die Eingabe in ein gefülltes Feld dessen Wert ersetzt, ohne die übrigen Ziffern zu verschieben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 52.7k
- Forks
- 13.3k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 65
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ionic-team/ionic-framework
-
bug: vue swipe cancellation throws when the previous page is missingEvtl. vergeben @dandoingdev hat das vor 33 Tagen übernommen. Offenpackage: vue type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ionic-team/ionic-framework#31514 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwardedEvtl. vergeben @HappyKnuckles hat das vor 28 Tagen übernommen. Offena11y package: core type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
ionic-team/ionic-framework#31492 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: IonTabs throws when a Fragment contains one IonRouterOutletEvtl. vergeben @Benziza hat das vor 69 Tagen übernommen. Offenpackage: react type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ionic-team/ionic-framework#31410 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
package: angular type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
ionic-team/ionic-framework#31291 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't workEvtl. vergeben @RaphaelFakhri hat das vor 10 Tagen übernommen. Offentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
ionic-team/ionic-framework#30738 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ionic-team/ionic-framework
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
riverqueue/river#1576 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[bug] A prompt queued during a run is assessed without its textEvtl. vergeben @jwiegley hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
DevMortimer/pi-warden#211 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
mattermost/compass-design#191 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add unit tests for the organization admin role checkEvtl. vergeben @SaffuSafwan hat das heute übernommen. Offenarea/core good first issue help wanted
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
elmohq/elmo#1095 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
HorusGoul/trizum#559 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag