MetaMask android application gets minimized

I am developing a dapp. It has a Web3Modal connect button and a button that triggers a transaction(using wagmi). When I open it in the MetaMask’s built-in browser and connect, the MetaMask app gets minimized and I have to restore it to view the web page. The same thing happens when a transaction is confirmed.