Wallet password dialog closes too easily

Description of the issue:
I have a website that uses Ethereum’s JS API to perform a personal_sign request. The problem is that when this code is executed a dialog pops up that requests the wallet’s password, but that dialog gets closed for pretty much any user interaction (even loss of application focus), which makes it really difficult to use a password manager browser extension, or any other application.

Are you using the (new) Brave Wallet or the (old) Crypto wallets implementation?

It’s the Brave Wallet.

How can this issue be reproduced?
Have some JS code on a website, something like:

if (typeof window.ethereum !== 'undefined') {
        const getAccount = async () => {
            const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
            const account = accounts[0];
            const message = "Hello world";
            const signature = await ethereum.request({ method: 'personal_sign', params: [message, account] });
            return {
                "account": account,
                "signature": signature,
            };
        }

        getAccount().then((result) => {
            document.forms[0].elements["account"].value = result.account;
            document.forms[0].elements["signature"].value = result.signature;
            submit();
        }).catch((e) => {
            console.log('Error: ', e);
        });
    }

then either try to click on a Bitwarden browser extension, or try to just switch to a different application than Brave.

Brave Version (check About Brave):
Version 1.46.140 Chromium: 108.0.5359.99 (Official Build) (x86_64)
](https://brave.com/latest/)

Additional Information:

Hi @aldaris

Are you able to share the site you are using, so we can test it out ?

Thanks,

Hubert

Sample code to reproduce this issue:

<html>
 <head>
  <title>Test</title>
 </head>
 <body>
  <script type="text/javascript">
   if (typeof window.ethereum !== 'undefined') {
        const getAccount = async () => {
            const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
            const account = accounts[0];
            const message = "__MESSAGE__";
            const signature = await ethereum.request({ method: 'personal_sign', params: [message, account] });
            return {
                "account": account,
                "signature": signature,
            };
        }

        getAccount().then((result) => {
            console.log("Signature" + result.signature);
        }).catch((e) => {
            console.log('Error: ', e);
            throw e;
        })
   }
  </script>
 </body>
</html>

Since then I’ve realized that while the wallet pop-up closes easily, you can get back to the same UI by clicking on the weird icon that attempts to resemble a wallet.
Potentially the wallet icon should change when there is a wallet action that requires user interaction.