Fixed range scaling on Slider component

This commit is contained in:
Fabio Manganiello 2022-04-30 23:40:14 +02:00
parent 30a024befb
commit 8e06b8c727
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -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}%`