Fix race condition for changing "currentValue"
One real world example, when using the `Slider` component as the audio play progress bar, the `value/currentValue` could be updated by listening the `timeupdate` event of the audio element or by user dragging interaction, but user interaction should have higher priority over the `timeupdate` event.
This commit is contained in:
parent
75abb3bb28
commit
f2d087145e
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@
|
||||||
watch: {
|
watch: {
|
||||||
value (val) {
|
value (val) {
|
||||||
val = this.checkLimits(Array.isArray(val) ? val : [val]);
|
val = this.checkLimits(Array.isArray(val) ? val : [val]);
|
||||||
if (val[0] !== this.currentValue[0] || val[1] !== this.currentValue[1]) {
|
if (!this.dragging && (val[0] !== this.currentValue[0] || val[1] !== this.currentValue[1])) {
|
||||||
this.currentValue = val;
|
this.currentValue = val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue