Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cp-12.13.0 fixes drag and drop in network list menu modal #30437

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Feb 19, 2025

Description

This PR fixes an issue with the drag-and-drop functionality in the network list menu by isolating the modal animation to only use opacity instead of transform. The transform animation was interfering with the react-beautiful-dnd library's positioning calculations, causing the draggable items to behave incorrectly.

The solution introduces a custom network-menu-fade animation in the index.scss file for the network menu modal, which only animates opacity and removes the transform property. This ensures the drag-and-drop functionality works as expected while maintaining a smooth fade-in animation.

Key Changes:

  • Added a custom network-menu-fade animation in index.scss.
  • Removed transform from the modal to fix drag-and-drop behavior.
  • Isolated the animation to the network menu component to avoid affecting other modals.

Open in GitHub Codespaces

Related issues

Fixes: #30436

Manual testing steps

  1. Open the MetaMask extension.
  2. Click on the network selector in the top left corner.
  3. Try to drag and reorder any of the enabled networks.
  4. Verify that the drag-and-drop functionality works smoothly and the modal fades in correctly.

Screenshots/Recordings

Before

  • Dragging network items was inconsistent or broken due to transform interference.
modal.slideup.720.mov

After

  • Network items can be dragged and reordered smoothly.
  • The modal fades in without any transform-related issues.
network.modal.fix720.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.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Feb 19, 2025
@georgewrmarshall georgewrmarshall self-assigned this Feb 19, 2025
Copy link
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.

@georgewrmarshall georgewrmarshall marked this pull request as ready for review February 19, 2025 17:58
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner February 19, 2025 17:58
Copy link
Member

@NidhiKJha NidhiKJha left a comment

Choose a reason for hiding this comment

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

LGTM

@metamaskbot
Copy link
Collaborator

Builds ready [a743d53]
Page Load Metrics (1583 ± 45 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28118031523302145
domContentLoaded1398174015649144
load1407175615839545
domInteractive19149372814
backgroundConnect95618136
firstReactRender1492402713
getState471162010
initialActions01000
loadScripts977132811249043
setupStore75918189
uiStartup16061983182110249
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@georgewrmarshall georgewrmarshall added this pull request to the merge queue Feb 19, 2025
Merged via the queue into main with commit f28216f Feb 19, 2025
90 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/30436/network-menu-drag-drop branch February 19, 2025 19:20
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
@metamaskbot metamaskbot added the release-12.14.0 Issue or pull request that will be included in release 12.14.0 label Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.14.0 Issue or pull request that will be included in release 12.14.0 team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Modal animation breaks drag and drop in network menu
4 participants