How to prevent Google One Tap from stealing the focus from an input?

118 Views Asked by At

If you use Google One Tap on a page which has an input or textarea with autofocus, or where you use focus() during the page load, Google One Tap removes the focus from the input field when it displays its login window.

This looks like a Google One Tap bug to me.

Is there a way to avoid it? And to report it?

1

There are 1 best solutions below

0
Max On

Agreed, this really should be configurable behaviour.

I mitigated it with:

window.addEventListener("blur", (_e) => setTimeout(() => window.focus(), 0))