mirror of
https://github.com/nextcloud/spreed.git
synced 2025-07-22 12:01:02 +00:00
Merge pull request #10039 from nextcloud/fix/noid/check-ref-before-scroll
fix(MessagesList) - check if list is rendered before scrolling
This commit is contained in:
@ -945,7 +945,11 @@ export default {
|
|||||||
* Scrolls to the bottom of the list smoothly.
|
* Scrolls to the bottom of the list smoothly.
|
||||||
*/
|
*/
|
||||||
smoothScrollToBottom() {
|
smoothScrollToBottom() {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(() => {
|
||||||
|
if (!this.$refs.scroller) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isWindowVisible && (document.hasFocus() || this.isInCall)) {
|
if (this.isWindowVisible && (document.hasFocus() || this.isInCall)) {
|
||||||
// scrollTo is used when the user is watching
|
// scrollTo is used when the user is watching
|
||||||
this.$refs.scroller.scrollTo({
|
this.$refs.scroller.scrollTo({
|
||||||
@ -970,7 +974,11 @@ export default {
|
|||||||
* Scrolls to the bottom of the list.
|
* Scrolls to the bottom of the list.
|
||||||
*/
|
*/
|
||||||
scrollToBottom() {
|
scrollToBottom() {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(() => {
|
||||||
|
if (!this.$refs.scroller) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
this.$refs.scroller.scrollTop = this.$refs.scroller.scrollHeight
|
this.$refs.scroller.scrollTop = this.$refs.scroller.scrollHeight
|
||||||
this.setChatScrolledToBottom(true)
|
this.setChatScrolledToBottom(true)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user