如何防止 Google One Tap 窃取输入焦点?

Ósc*_*car 5 javascript google-api autofocus google-signin google-one-tap

如果您在带有 或 的页面上使用Google One Tap 或者在页面加载过程中使用Google One Tap,则 Google One Tap 会在显示其登录窗口时从输入字段中删除焦点。inputtextareaautofocusfocus()

对我来说,这看起来像是 Google One Tap 错误。

有办法避免吗?并举报?

Max*_*Max 1

同意,这确实应该是可配置的行为。

我用以下方法缓解了它:

window.addEventListener("blur", (_e) => setTimeout(() => window.focus(), 0))
Run Code Online (Sandbox Code Playgroud)