Skip to content

Commit 46a3409

Browse files
authored
Merge pull request #1624 from curvefi/fix/cant-type-search-wallet-in-wc
fix: can't enter input in search wallet when connecting to walletconnect
2 parents 3b612d1 + 23bc6f3 commit 46a3409

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

packages/curve-ui-kit/src/features/connect-wallet/ui/WagmiConnectModal.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,29 @@ export const WagmiConnectModal = () => {
7979
}))
8080

8181
return (
82-
<ModalDialog open={showModal} onClose={closeModal} title={t`Connect Wallet`} titleAction={<WalletIcon />} compact>
82+
<ModalDialog
83+
open={showModal}
84+
onClose={closeModal}
85+
title={t`Connect Wallet`}
86+
titleAction={<WalletIcon />}
87+
compact
88+
sx={{
89+
/*
90+
When connecting with WalletConnect, we hide this dialog because the MUI Dialog
91+
component adds a tabIndex of -1 to its container. This prevents text input in
92+
the "Search wallet" field of the WC modal — it's not a z-index issue, but
93+
caused by the tabIndex itself.
94+
95+
Although MUI provides a slotProp for the container, the tabIndex is still set
96+
to -1 internally, regardless of what you specify. Other slotProps work fine,
97+
so this behavior seems hardcoded in MUI.
98+
99+
The most reliable fix is to skip rendering this modal while WalletConnect
100+
is connecting, rather than patching the tabIndex via a flaky JavaScript hack.
101+
*/
102+
...(isConnectingType === 'walletConnect' && { display: 'none' }),
103+
}}
104+
>
83105
{error ? (
84106
<Alert variant="filled" severity="error">
85107
<AlertTitle>{t`Error connecting wallet`}</AlertTitle>

0 commit comments

Comments
 (0)