Skip to content

fix: increase clickable outside area from asset list control buttons#39823

Merged
ameliejyc merged 2 commits intomainfrom
fix-click-outisde-area-on-asset-list-control-bar
Feb 5, 2026
Merged

fix: increase clickable outside area from asset list control buttons#39823
ameliejyc merged 2 commits intomainfrom
fix-click-outisde-area-on-asset-list-control-bar

Conversation

@ameliejyc
Copy link
Contributor

@ameliejyc ameliejyc commented Feb 5, 2026

Description

Fixes an issue where clicking outside the sort/import popovers did not close them.

Root cause: All popovers used the entire asset-list-control-bar Box as their referenceElement. The Popover's onClickOutside excludes clicks inside the reference element, making the exclusion zone too large.

Solution: Use specific refs for each popover trigger button instead of the entire control bar:

  • Created sortButtonRef for the sort button
  • Created importButtonRef for the import control button
  • Updated ImportControl to use forwardRef to receive the ref
  • Removed unused Network Filter Popover and related dead code

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Increased clickable area to close buttons in asset list control bar

Related issues

Fixes: #37628

Manual testing steps

  1. Open the extension and go to the Portfolio view (Tokens tab)
  2. Click the sort/filter button (funnel icon) to open the sort popover
  3. Click on the "NFTs" or "Activity" tab
  4. Verify the popover closes
  5. Repeat with the vertical "..." menu popover

Screenshots/Recordings

Before

See issue description

After

increase.clickable.area.outside.asset.list.control.bar.buttons.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
UI-only refactoring of popover anchoring and minor test updates; low risk aside from potential popover positioning/regression in click-outside behavior.

Overview
Fixes a UX bug where clicking “outside” the asset list sort/import popovers wouldn’t close them by changing each Popover’s referenceElement from the whole control bar to a dedicated ref on the corresponding trigger button.

ImportControl is updated to forwardRef so the import popovers can anchor to the actual button, and dead network-filter popover state/code is removed. Tests are adjusted to use consistent fireEvent.click interactions.

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

@ameliejyc ameliejyc requested a review from a team as a code owner February 5, 2026 14:52
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

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-core-extension-ux Core Extension UX team label Feb 5, 2026
@ameliejyc ameliejyc changed the title chore: increase clickable outside area from asset list control button popovers chore: increase clickable outside area from asset list control buttons Feb 5, 2026
@github-actions github-actions bot added the size-M label Feb 5, 2026
@ameliejyc ameliejyc changed the title chore: increase clickable outside area from asset list control buttons fix: increase clickable outside area from asset list control buttons Feb 5, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 5, 2026

✨ Files requiring CODEOWNER review ✨

💎 @MetaMask/metamask-assets (3 files, +41 -76)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 assets/
          • 📁 asset-list/
            • 📁 asset-list-control-bar/
              • 📄 asset-list-control-bar.test.tsx +4 -7
              • 📄 asset-list-control-bar.tsx +10 -44
            • 📁 import-control/
              • 📄 import-control.tsx +27 -25

@ameliejyc ameliejyc enabled auto-merge February 5, 2026 17:04
@ameliejyc ameliejyc added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit eec2664 Feb 5, 2026
182 checks passed
@ameliejyc ameliejyc deleted the fix-click-outisde-area-on-asset-list-control-bar branch February 5, 2026 17:50
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
@metamaskbot metamaskbot added the release-13.18.0 Issue or pull request that will be included in release 13.18.0 label Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.18.0 Issue or pull request that will be included in release 13.18.0 size-M team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Click outside of filter or sort modal should close it

4 participants