Skip to content

Commit

Permalink
fix(van-stepper): fix onChange event exceeded 'max' after setting the…
Browse files Browse the repository at this point in the history
… max prop (#5741)
  • Loading branch information
Lick-liu committed Apr 12, 2024
1 parent 50da9f8 commit 348c310
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/stepper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,7 @@ VantComponent({
return;
}

let formatted = this.filter(value);

// limit max decimal length
if (isDef(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
const pair = formatted.split('.');
formatted = `${pair[0]}.${pair[1].slice(0, this.data.decimalLength)}`;
}
let formatted = this.format(value);

this.emitChange(formatted);
},
Expand Down

0 comments on commit 348c310

Please sign in to comment.