Fix #4689 - ScrollPanel: TypeError: Cannot read properties of null (reading 'scrollWidth')

pull/4696/head
FlipWarthog 2023-10-25 18:28:41 -04:00
parent 12333edd7c
commit 4fb793a33c
1 changed files with 30 additions and 28 deletions

View File

@ -103,6 +103,7 @@ export default {
} }
}, },
moveBar() { moveBar() {
if (this.$refs.content) {
/* horizontal scroll */ /* horizontal scroll */
let totalWidth = this.$refs.content.scrollWidth; let totalWidth = this.$refs.content.scrollWidth;
let ownWidth = this.$refs.content.clientWidth; let ownWidth = this.$refs.content.clientWidth;
@ -136,6 +137,7 @@ export default {
this.$refs.yBar.style.cssText = 'height:' + Math.max(this.scrollYRatio * 100, 10) + '%; top: calc(' + (this.$refs.content.scrollTop / totalHeight) * 100 + '% - ' + this.$refs.xBar.clientHeight + 'px);right:' + right + 'px;'; this.$refs.yBar.style.cssText = 'height:' + Math.max(this.scrollYRatio * 100, 10) + '%; top: calc(' + (this.$refs.content.scrollTop / totalHeight) * 100 + '% - ' + this.$refs.xBar.clientHeight + 'px);right:' + right + 'px;';
} }
}); });
}
}, },
onYBarMouseDown(e) { onYBarMouseDown(e) {
this.isYBarClicked = true; this.isYBarClicked = true;