Skip to content

Commit

Permalink
Fix group slider triggering change, fixes #789 (#1001)
Browse files Browse the repository at this point in the history
Signed-off-by: Hubert Nusser <[email protected]>
  • Loading branch information
hubsif authored Apr 18, 2021
1 parent 0bcbd8c commit dd6e756
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ export default {
},
toStepFixed (value) {
// uses the number of decimals in the step config to round the provided number
if (!this.config.step) return value
const nbDecimals = Number(this.config.step).toString().replace(',', '.').split('.')[1]
const nbDecimals = this.config.step ? Number(this.config.step).toString().replace(',', '.').split('.')[1] : 0
return parseFloat(Number(value).toFixed(nbDecimals))
},
onChange (value) {
const newValue = this.toStepFixed(value)
if (newValue === this.value) return
if (newValue === this.toStepFixed(this.value)) return
if (this.config.variable) {
this.$set(this.context.vars, this.config.variable, value)
} else if (this.config.item) {
Expand Down

0 comments on commit dd6e756

Please sign in to comment.