fix: disable closing price impact modal while submitting a trade#40811
Merged
fix: disable closing price impact modal while submitting a trade#40811
Conversation
Contributor
✨ Files requiring CODEOWNER review ✨🔄 @MetaMask/swaps-engineers (3 files, +3 -6)
|
|
Contributor
Builds ready [d434b80]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
SteP-n-s
approved these changes
Mar 11, 2026
ghgoodreau
approved these changes
Mar 11, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Description
Fixes a bug in which the priceImpact modal automatically closes after tx submission, which allows re-submitting the same trade. This change disables closing the modal when the modal overlay is clicked and also removes
onClosecall after the transaction is submittedChangelog
CHANGELOG entry: fix: disable closing price impact modal while submitting a trade
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4256
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the bridge submission UX/control flow by keeping the price impact modal open and adjusting post-submit navigation, which could affect error handling and prevent/allow unintended resubmissions.
Overview
Prevents the
BridgePriceImpactWarningModal(submit CTA variant) from being dismissed via outside click/escape during submission and removes the automaticonClose()after clicking Proceed, keeping the modal open until explicitly cancelled.Adjusts bridge submission error handling in
useSubmitBridgeTransactionby no longer immediately navigating to the Activity page from the catch block (only hardware-wallet rejections redirect back to the bridge page), and updates the modal test expectations accordingly.Written by Cursor Bugbot for commit d434b80. This will update automatically on new commits. Configure here.