Merge pull request #4696 from FlipWarthog/PV4689

Fix #4689 - ScrollPanel: TypeError: Cannot read properties of null (reading 'scrollWidth')
pull/4704/head
Tuğçe Küçükoğlu 2023-10-26 11:55:10 +03:00 committed by GitHub
commit cf94e06718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;