Fix scan not enabling continue button on recipient screens#540
Open
n13 wants to merge 5 commits into
Open
Conversation
Scanning an address left the send and multisig-propose recipient buttons stuck on "Enter address". Scan assigned the controller text inside setState, firing the change listener's nested setState mid-update, so validation never enabled the button. Route scan, paste, and recent through a shared _setRecipient helper that assigns the controller text outside setState (the same path paste already used), letting the listener drive validation. Also removes the duplicated assignment across the three input methods in both screens.
align with design, delete duplicated screens from msig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On the send recipient screen, scanning an address left the bottom button stuck on "Enter address" instead of becoming "Continue" — the scanned address was accepted but the button never enabled. The same bug existed on the multisig propose recipient screen.
Root cause
Paste and scan took different code paths:
_recipientController.textoutsidesetState, so the controller's_onRecipientChangedlistener fired naturally, ran validation, cleared_hasAddressError, and enabled the button._recipientController.textinsidesetState, which fires the listener synchronously during the outersetStateand triggers a nestedsetStatefor validation — so the button state didn't update.Fix
Unified scan, paste, and recent-tap through a single
_setRecipienthelper that assigns the controller text last and outsidesetState(the path paste already used), letting the listener drive validation and the continue button. This also removes the duplicated assignment that was repeated across the three input methods in each screen.Applied identically to:
mobile-app/lib/v2/screens/send/select_recipient_screen.dartmobile-app/lib/v2/screens/multisig/propose/propose_recipient_screen.dartTest plan