recalculate oh-slider when rendered, fixes #967 (#975)

Signed-off-by: Hubert Nusser <hubsif@gmx.de>
pull/980/head
hubsif 2021-03-27 00:34:26 +01:00 committed by GitHub
parent 7cbdc3cc32
commit 45b67da65e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<template>
<f7-range class="oh-slider" v-bind="config" :value="value" @range:changed="onChange" :format-label="formatLabel" :format-scale-label="formatScaleLabel" />
<f7-range ref="rangeslider" class="oh-slider" v-bind="config" :value="value" @range:changed="onChange" :format-label="formatLabel" :format-scale-label="formatScaleLabel" />
</template>
<style lang="stylus">
@ -17,6 +17,13 @@ export default {
widget: OhSliderDefinition,
mounted () {
delete this.config.value
// f7-range inside of masonry can get rendered faulty, as the masonry changes its breakpoint layout after being rendered
// re-calculate the range slider after masonry is updated
setTimeout(() => {
this.$refs.rangeslider.f7Range.calcSize()
this.$refs.rangeslider.f7Range.layout()
}, 0)
},
computed: {
value () {