소스 검색

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 () {