浏览代码

Fix an issue where .focus() is scrolling the page, same as in UrlUI

Artur Paikin 6 年之前
父节点
当前提交
363eb46cec
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/views/ProviderView/AuthView.js

+ 3 - 1
src/views/ProviderView/AuthView.js

@@ -3,7 +3,9 @@ const { h, Component } = require('preact')
 
 class AuthBlock extends Component {
   componentDidMount () {
-    this.connectButton.focus()
+    setTimeout(() => {
+      this.connectButton.focus({ preventScroll: true })
+    }, 150)
   }
 
   render () {