fix: only set date/number facets selected if values have changed
For displaying the badge, we need to know when custom values have been set. Also, this prevent useless facet checks when user has changed one value then changed it back to default.
This commit is contained in:
parent
701b00f4f7
commit
43755c81fa
1 changed files with 14 additions and 3 deletions
|
@ -843,11 +843,22 @@ L.FormBuilder.MinMaxBase = L.FormBuilder.Element.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
toJS: function () {
|
toJS: function () {
|
||||||
return {
|
const opts = {
|
||||||
type: this.type,
|
type: this.type,
|
||||||
min: this.minInput.value,
|
|
||||||
max: this.maxInput.value,
|
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
this.minInput.value !== '' &&
|
||||||
|
this.minInput.value !== this.minInput.dataset.value
|
||||||
|
) {
|
||||||
|
opts.min = this.minInput.value
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
this.maxInput.value !== '' &&
|
||||||
|
this.maxInput.value !== this.maxInput.dataset.value
|
||||||
|
) {
|
||||||
|
opts.max = this.maxInput.value
|
||||||
|
}
|
||||||
|
return opts
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue