Skip to content

fix: prevent search field going out of bounds when keyboard shown#25393

Merged
infiniteflower merged 1 commit intomainfrom
swaps-3860-account-search-oob
Jan 29, 2026
Merged

fix: prevent search field going out of bounds when keyboard shown#25393
infiniteflower merged 1 commit intomainfrom
swaps-3860-account-search-oob

Conversation

@infiniteflower
Copy link
Copy Markdown
Contributor

@infiniteflower infiniteflower commented Jan 29, 2026

Description

This PR fixes a bug where in the Swaps recipient account picker, if the user clicked on the search input bar, the keyboard would push the search input off screen.

Changelog

CHANGELOG entry: Fixed a bug where in the Swaps recipient account picker, if the user clicked on the search input bar, the keyboard would push the search input off screen.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3860

Manual testing steps

Feature: Swaps recipient account search fix

  Scenario: user trying to bridge
    Given user is searching for a recipient account in Swaps

    When user clicks on the search bar
    Then the search bar remains on screen

Screenshots/Recordings

Before

After

Screen.Recording.2026-01-29.at.3.57.23.PM.mov

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

Low Risk
Low risk UI behavior change limited to the recipient selector bottom sheet’s keyboard handling; no changes to quoting, routing, or address selection logic.

Overview
Prevents the Bridge/Swaps recipient selector search field from being pushed off-screen when the keyboard appears by making BottomSheet’s keyboardAvoidingViewEnabled stateful and letting MultichainAccountSelectorList toggle it based on list size.

Also sets the list’s keyboardDismissMode to on-drag to improve keyboard dismissal while scrolling.

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

…ppears

Add proper keyboard avoiding view state management to RecipientSelectorModal,
following the same pattern used in AccountSelector. This allows the
MultichainAccountSelectorList to dynamically control keyboard avoiding behavior
based on content, ensuring the search input stays visible when typing.

Also dismiss keyboard when scrolling the account list for better UX.
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Jan 29, 2026
@infiniteflower infiniteflower changed the title fix(bridge): prevent search field going out of bounds when keyboard a… fix: prevent search field going out of bounds when keyboard shown Jan 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The change modifies the RecipientSelectorModal component in the Bridge flow to improve keyboard handling behavior. Specifically:

  1. Added state management for keyboardAvoidingViewEnabled (previously hardcoded to true)
  2. Passing setKeyboardAvoidingViewEnabled to MultichainAccountSelectorList - this allows dynamic keyboard avoiding behavior based on account count
  3. Added keyboardDismissMode="on-drag" - allows dismissing keyboard by dragging the list

This is a minor UI/UX improvement that:

  • Follows an existing pattern already used in AccountSelector.tsx
  • Uses props that MultichainAccountSelectorList already supports
  • Is isolated to the Bridge recipient selection modal

The SmokeTrade tag is appropriate because:

  • Bridge functionality tests are tagged with SmokeTrade (as seen in bridge-action-smoke.spec.ts)
  • The change affects the bridge flow's recipient selection experience

Risk is low because:

  • No core logic changes, just keyboard handling improvements
  • The pattern is already proven in other parts of the codebase
  • Changes are isolated to a single modal component

Performance Test Selection:
This change only affects keyboard handling behavior in a modal component. It adds a simple useState hook and passes props to control keyboard avoiding behavior. There are no changes to rendering performance, data loading, list rendering, or any computationally intensive operations. The change is purely about improving keyboard UX and does not warrant performance testing.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@infiniteflower infiniteflower marked this pull request as ready for review January 29, 2026 20:59
@infiniteflower infiniteflower requested a review from a team as a code owner January 29, 2026 20:59
@infiniteflower infiniteflower added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 0578c24 Jan 29, 2026
114 of 118 checks passed
@infiniteflower infiniteflower deleted the swaps-3860-account-search-oob branch January 29, 2026 21:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.65.0 Issue or pull request that will be included in release 7.65.0 size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants