Skip to content

Commit

Permalink
fix(Slider): range mode not use on value is empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Sep 14, 2024
1 parent 920e623 commit 3a546cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export default mixins(classPrefixMixins).extend({
const { min, max, value } = this;
if (this.range) {
if (Array.isArray(value)) {
this.firstValue = Math.max(min || 0, value[0]);
this.secondValue = Math.min(max || 100, value[1]);
this.firstValue = Math.max(min || 0, value[0] ?? 0);
this.secondValue = Math.min(max || 100, value[1] ?? 0);
} else {
this.firstValue = min || 0;
this.secondValue = max || 100;
Expand Down

0 comments on commit 3a546cc

Please sign in to comment.