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:
parent
31a6ec6857
commit
56162c7a69
|
@ -88,7 +88,7 @@
|
||||||
firstTime = false
|
firstTime = false
|
||||||
let { autoFocus } = this.get()
|
let { autoFocus } = this.get()
|
||||||
if (autoFocus) {
|
if (autoFocus) {
|
||||||
requestAnimationFrame(() => textarea.focus())
|
requestAnimationFrame(() => textarea.focus({ preventScroll: true }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// return status to the reply button after posting a reply
|
// 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 */ }
|
} catch (e) { /* ignore */ }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -280,7 +280,7 @@
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
let element = document.getElementById(lastFocusedElementId)
|
let element = document.getElementById(lastFocusedElementId)
|
||||||
if (element) {
|
if (element) {
|
||||||
element.focus()
|
element.focus({ preventScroll: true })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue