fix: fix timeline jumping on focus (#1039)

This should fix #840. I can't see any reason why we would want it to scroll when we're focusing these things.
This commit is contained in:
Nolan Lawson 2019-02-23 12:32:18 -08:00 committed by GitHub
parent 31a6ec6857
commit 56162c7a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@
firstTime = false
let { autoFocus } = this.get()
if (autoFocus) {
requestAnimationFrame(() => textarea.focus())
requestAnimationFrame(() => textarea.focus({ preventScroll: true }))
}
}
})

View File

@ -147,7 +147,7 @@
}
try {
// return status to the reply button after posting a reply
this.refs.node.querySelector('.status-toolbar-reply-button').focus()
this.refs.node.querySelector('.status-toolbar-reply-button').focus({ preventScroll: true })
} catch (e) { /* ignore */ }
}
},

View File

@ -280,7 +280,7 @@
requestAnimationFrame(() => {
let element = document.getElementById(lastFocusedElementId)
if (element) {
element.focus()
element.focus({ preventScroll: true })
}
})
})