Skip to content

Conversation

@OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 10, 2025

Description

This PR aims to fix recipient input to show multiline for selected address in send flow

Changelog

CHANGELOG entry: Fix recipient to be shown multi-line in send flow

Related issues

Fixes: #22207

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Screenshot 2025-11-10 at 12 03 50

After

Screenshot 2025-11-10 at 12 03 43

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Replaces direct TextField props with a custom Input element to force single-line recipient addresses and prevent multiline behavior.

  • Confirmations › RecipientInput (app/components/Views/confirmations/components/recipient-input/recipient-input.tsx)
    • Use TextField inputElement with foundation/Input to control behavior.
      • Configure single-line input: multiline={false}, numberOfLines={1}, scrollEnabled={false}, textAlignVertical="center", textBreakStrategy="simple".
      • Move input props (value, change handlers, autocorrect/spellcheck/autocomplete/capitalize, placeholder, autofocus, testID) onto Input.
      • Apply INPUT_STYLE_OVERRIDE to remove height/lineHeight and pad adjustments; disable state styles; set textVariant via TOKEN_TEXTFIELD_INPUT_TEXT_VARIANT.
    • Keep start/end accessories (To label, Clear/Paste buttons) unchanged.

Written by Cursor Bugbot for commit e06f20c. This will update automatically on new commits. Configure here.

@OGPoyraz OGPoyraz requested a review from a team as a code owner November 10, 2025 11:05
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Nov 10, 2025
/>
),
[to, handleTextChange],
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid useMemo for jsx fragments like this, We should rather prefer to create a separate small component. Or put it ininline.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jpuri, fair comment - I forgot to remove that while trying to understand issue - making this inline.

@OGPoyraz OGPoyraz requested a review from jpuri November 10, 2025 13:06
@OGPoyraz OGPoyraz enabled auto-merge November 10, 2025 13:06
testID="recipient-address-input"
isStateStylesDisabled
style={INPUT_STYLE_OVERRIDE}
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Focus Management Fails for Custom Input.

The custom Input element doesn't receive onBlur and onFocus handlers that TextField uses internally to manage its isFocused state. When inputElement is provided, TextField bypasses its internal handlers, breaking focus-dependent styling and preventing any parent onBlur/onFocus callbacks from being invoked. The custom Input needs explicit onBlur and onFocus props to maintain proper focus state management.

Fix in Cursor Fix in Web

testID="recipient-address-input"
isStateStylesDisabled
style={INPUT_STYLE_OVERRIDE}
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Custom Input Breaks TextField Focus Management

The custom Input element passed via inputElement bypasses TextField's internal focus/blur handlers and ref management. This breaks the TextField's focus state tracking (affecting visual styling), prevents the parent component's onBlur/onFocus callbacks from firing, and disables the ability to focus the input by pressing anywhere on the TextField container. The custom Input needs onBlur and onFocus handlers that call TextField's internal handlers, or these handlers need to be passed through somehow.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

@OGPoyraz OGPoyraz added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main with commit 3602c24 Nov 12, 2025
86 checks passed
@OGPoyraz OGPoyraz deleted the ogp/22207 branch November 12, 2025 11:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: BTC address doesn't fit in recipient field

4 participants