feat(ramps): clears input on back button keyboard press#26776
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| const [userHasEnteredAmount, setUserHasEnteredAmount] = useState(false); | ||
| const [keyboardIsDirty, setKeyboardIsDirty] = useState(false); |
There was a problem hiding this comment.
both of these are needed, despite looking like the same state.
userHasEnteredAmount can become true without any user action (region default). keyboardIsDirty becomes true only after a keypad interaction, which is what we need for “clear only if they haven’t touched the keypad.”
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are well-contained to the Ramps feature with no impact on other wallet functionality. The E2E test file is in the Performance Test Selection: |
The committed fixture schema is out of date. To update, comment: |
Description
This is a small PR based on a feature request from QA. It will clear ramp input if the user clicks the "back button" on the ramp keyboard.
Changelog
CHANGELOG entry: improved keyboard UX for buy feature
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3304
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes amount-entry behavior on the unified buy flow; incorrect handling could break quote fetching/continue enablement for some input sequences. Scope is limited to the
BuildQuotekeypad interaction and corresponding tests.Overview
Improves unified-buy amount entry UX by making the first
Keypadback/delete press clear the initial default amount (e.g.,100→0) instead of deleting a single digit.Adds a
keyboardIsDirtyflag inBuildQuoteto differentiate the initial default state from user-modified input, and updateshandleKeypadChangeto special-casepressedKey === Keys.Back.Updates unit tests to cover the new delete/back behavior and adjusts the unified-buy smoke test to match the new input sequence (single delete, then enter
15).Written by Cursor Bugbot for commit 9b1f8e6. This will update automatically on new commits. Configure here.