Procházet zdrojové kódy

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

Artur Paikin před 6 roky
rodič
revize
363eb46cec
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  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 () {