forked from platypush/platypush
Fixed range scaling on Slider component
This commit is contained in:
parent
30a024befb
commit
8e06b8c727
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
update(value) {
|
update(value) {
|
||||||
const percent = (value * 100) / (this.range[1] - this.range[0])
|
const percent = ((value - this.range[0]) * 100) / (this.range[1] - this.range[0])
|
||||||
this.$refs.thumb.style.left = `${percent}%`
|
this.$refs.thumb.style.left = `${percent}%`
|
||||||
this.$refs.thumb.style.transform = `translate(-${percent}%, -50%)`
|
this.$refs.thumb.style.transform = `translate(-${percent}%, -50%)`
|
||||||
this.$refs.track.style.width = `${percent}%`
|
this.$refs.track.style.width = `${percent}%`
|
||||||
|
|
Loading…
Reference in a new issue