Przeglądaj źródła

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

Artur Paikin 6 lat temu
rodzic
commit
363eb46cec
1 zmienionych plików z 3 dodań i 1 usunięć
  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 () {