From 09bb6aa8ddba4cf5bc63a0b7055654f7fbbe239b Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 14:45:22 -0400 Subject: [PATCH] fix: prevent asset to buy dropdown from opening if asset to buy is already set (#1693) --- src/entries/popup/pages/swap/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/entries/popup/pages/swap/index.tsx b/src/entries/popup/pages/swap/index.tsx index fca9dc4f28..9b57f71ecb 100644 --- a/src/entries/popup/pages/swap/index.tsx +++ b/src/entries/popup/pages/swap/index.tsx @@ -799,7 +799,9 @@ export function Swap({ bridge = false }: { bridge?: boolean }) { } setAssetToSellInputValue={setAssetToSellInputValue} inputRef={assetToSellInputRef} - openDropdownOnMount={inputToOpenOnMount === 'sell'} + openDropdownOnMount={ + inputToOpenOnMount === 'sell' && !assetToSell + } assetToSellNativeValue={assetToSellNativeValue} assetToSellNativeDisplay={assetToSellNativeDisplay} setAssetToSellInputNativeValue={ @@ -881,7 +883,9 @@ export function Swap({ bridge = false }: { bridge?: boolean }) { assetToSellValue={assetToSellValue} setAssetToBuyInputValue={setAssetToBuyInputValue} inputRef={assetToBuyInputRef} - openDropdownOnMount={inputToOpenOnMount === 'buy'} + openDropdownOnMount={ + inputToOpenOnMount === 'buy' && !assetToBuy + } inputDisabled={isCrosschainSwap} assetToBuyNativeDisplay={assetToBuyNativeDisplay} assetToSellNativeDisplay={assetToSellNativeDisplay}