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
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ export default {
},
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.transform = `translate(-${percent}%, -50%)`
this.$refs.track.style.width = `${percent}%`