fix(pinCodeInput): delete previous digit instantly on backspace#736
Conversation
|
update changelog with number of ticket and update the branch |
# Conflicts: # ouds_core/lib/components/pin_code_input/digit_input/ouds_digit_input.dart
8cbd6dd to
8d872ca
Compare
|
Hi, The two PRs are already open in
Both target What you're probably seeing is that the source branches live on my fork ( If you'd prefer the branches to live directly inside Thanks, |
Related issues
Closes #735
Description
Fixes a UX defect in
OudsPinCodeInputwhere deleting the most-recently-typed digit required two backspace presses instead of one: the first press only moved focus to the previous cell, the second press finally deleted the character.After this change, a single backspace on an empty cell does both in one step:
TextFieldto handle a second keystroke).The cleanup is lifted up to
OudsPinCodeInput(which has access to the full controller list and focus nodes) via a new optionalonBackspaceOnEmptycallback onOudsDigitInput. The handler:index == 0or the controllers/focus-nodes lists are out of bounds.onChangedwith the truncated PIN only when the previous cell actually held a character (no spurious notifications when walking back through empty cells).Behavior on a non-empty cell is unchanged — the underlying
TextFieldstill handles in-cell deletion on the first press as before.Motivation & Context
Standard PIN-code UX (system keypads, banking apps) deletes the previous digit on a single backspace. The current two-press behavior breaks user muscle memory and makes the component feel laggy when correcting typos. The earlier implementation only called
previousFocus()on an empty cell and relied on the next keystroke for the actual deletion.Types of change
Previews
Checklist
Contribution
Accessibility
Design
Development
Documentation
Checklist (for Core Team only)