Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,29 @@ export const WagmiConnectModal = () => {
}))

return (
<ModalDialog open={showModal} onClose={closeModal} title={t`Connect Wallet`} titleAction={<WalletIcon />} compact>
<ModalDialog
open={showModal}
onClose={closeModal}
title={t`Connect Wallet`}
titleAction={<WalletIcon />}
compact
sx={{
/*
When connecting with WalletConnect, we hide this dialog because the MUI Dialog
component adds a tabIndex of -1 to its container. This prevents text input in
the "Search wallet" field of the WC modal — it's not a z-index issue, but
caused by the tabIndex itself.

Although MUI provides a slotProp for the container, the tabIndex is still set
to -1 internally, regardless of what you specify. Other slotProps work fine,
so this behavior seems hardcoded in MUI.

The most reliable fix is to skip rendering this modal while WalletConnect
is connecting, rather than patching the tabIndex via a flaky JavaScript hack.
*/
...(isConnectingType === 'walletConnect' && { display: 'none' }),
Copy link
Collaborator

Choose a reason for hiding this comment

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

The magic string isn't ideal

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not a magic string, it's the built in string type literal from wagmi! 😔

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's why enums are better 🤓

}}
>
{error ? (
<Alert variant="filled" severity="error">
<AlertTitle>{t`Error connecting wallet`}</AlertTitle>
Expand Down
Loading