Prevent scrolling when focusing on input (when Url tab is opened)

This commit is contained in:
Artur Paikin 2018-02-27 10:49:58 -05:00
parent 47cd7a778b
commit 179bdf7f84
2 changed files with 6 additions and 6 deletions

View file

@ -7,7 +7,12 @@ class UrlUI extends Component {
}
componentDidMount () {
this.input.focus()
// My guess about why browser scrolls to top on focus:
// Component is mounted right away, but the tab panel might be animating
// still, so input element is positioned outside viewport. This fixes it.
setTimeout(() => {
this.input.focus({ preventScroll: true })
}, 150)
}
handleClick () {

View file

@ -25,8 +25,3 @@
font-size: 16px;
padding: 12px;
}
// .uppy-Url-importButton-icon {
// width: 100%;
// height: 100%;
// }