Problem: hidden content does not always work right

Solution: clean up hidden content
This commit is contained in:
Peter Stuifzand 2022-04-18 14:15:56 +02:00
parent b3f21184c6
commit 3e1695e6f3

View File

@ -216,15 +216,18 @@ export default {
}, },
toggleHiddenContent() { toggleHiddenContent() {
this.hiddenContentVisible = !this.hiddenContentVisible this.hiddenContentVisible = !this.hiddenContentVisible
const el = this.$refs['content-container'] // const el = this.$refs['content-container']
el.scrollIntoView(true) // el.scrollIntoView(true)
} }
}, },
mounted() { mounted() {
this.showFooterButtons = true this.showFooterButtons = true
const el = this.$refs['content-container'] const el = this.$refs['content-container']
this.hiddenContentVisible = false
this.$nextTick(() => {
this.hasHiddenContent = el.scrollHeight > el.clientHeight this.hasHiddenContent = el.scrollHeight > el.clientHeight
})
}, },
computed: { computed: {
@ -377,8 +380,10 @@ export default {
console.log('ref content-container not found') console.log('ref content-container not found')
return return
} }
this.hasHiddenContent = el.scrollHeight > el.clientHeight
this.hiddenContentVisible = false this.hiddenContentVisible = false
this.$nextTick(() => {
this.hasHiddenContent = el.scrollHeight > el.clientHeight
})
}) })
} }
} }