mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
Prevent scrolling when focusing on input (when Url tab is opened)
This commit is contained in:
parent
47cd7a778b
commit
179bdf7f84
2 changed files with 6 additions and 6 deletions
|
|
@ -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 () {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,3 @@
|
|||
font-size: 16px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
// .uppy-Url-importButton-icon {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue