Преглед изворни кода

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