bug: input-otp, backspace in an empty box only moves focus instead of clearing the previous box
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- angular, ios, typescript
調査の方向性
core/src/components/input-otp/input-otp.tsx から始め、onKeyDown の空のボックス分岐と onInput の挿入およびシフト分岐を確認してください。iPhone 上の Basic Usage デモで 3 桁を入力してから Backspace を押すと再現できます。空のボックスで Backspace を押すと前の値がクリアされ、入力済みのボックスに入力すると、残りの桁をシフトさせずにその値が置き換えられれば修正完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 52.7k
- フォーク
- 13.3k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 65
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ionic-team/ionic-framework のほかの issue
-
bug: vue swipe cancellation throws when the previous page is missing対応中かも @dandoingdev が 33 日前に担当しました。 オープンpackage: vue type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ionic-team/ionic-framework#31514 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: ion-searchbar input is always labelled "search text"; aria-label on the host is not forwarded対応中かも @HappyKnuckles が 28 日前に担当しました。 オープンa11y package: core type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ionic-team/ionic-framework#31492 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: IonTabs throws when a Fragment contains one IonRouterOutlet対応中かも @Benziza が 69 日前に担当しました。 オープンpackage: react type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ionic-team/ionic-framework#31410 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
package: angular type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
ionic-team/ionic-framework#31291 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: ion-range: Clicking/Tapping on the Last tick doesn't work対応中かも @RaphaelFakhri が 10 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ionic-team/ionic-framework#30738 ·
メンテナーはふだん 1 日以内に返信
ionic-team/ionic-framework の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DSpace/dspace-angular#6511 ·
メンテナーはふだん 1 日以内に返信
-
area: frontend area:byok bug severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Phone app shows Unknown for a remote machine whose key changed対応中かも @janicduplessis が今日担当しました。 オープンarea: mobile priority: P3 type: bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
appandflow/stim#5006 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Area - Local to Cloud Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/vscode-mssql#23209 ·
メンテナーはふだん 1 日以内に返信