Text selection is cancelled when the AI popup disappears

The problem is not related to any plugin or theme. It continues even when you try turning off add-ons in safe mode. I tried with another theme, the problem still persists.