I created a minimal version of this to narrow down the issue. Minimal version does not have the issue so I suspect custom code at play is messing it up. Try removing things to see what's causing the issue. Btw when i tried the login form, nothing happened, including no error in the console.
Here's my minmal attemtp at reproduction
https://playground-r7uu4.wstd.io/login?