Skip to content

Commit

Permalink
fix: stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
jc9702507 committed Apr 23, 2023
1 parent 5b8754e commit cd07084
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Stepper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ Component({
const addTemp = upStep(value, step, precision);
result = Math.min(addTemp, max);
}
const { needUpdate } = this.update(result);
if (this.props.onChange && needUpdate) {
if (!this.isControlled()) {
const { needUpdate } = this.update(result);

Check warning on line 102 in src/Stepper/index.ts

View check run for this annotation

Codecov / codecov/patch

src/Stepper/index.ts#L102

Added line #L102 was not covered by tests
if (!needUpdate) {
return;

Check warning on line 104 in src/Stepper/index.ts

View check run for this annotation

Codecov / codecov/patch

src/Stepper/index.ts#L104

Added line #L104 was not covered by tests
}
}
if (this.props.onChange) {
this.props.onChange(result, fmtEvent(this.props, e));
}
}
Expand Down

0 comments on commit cd07084

Please sign in to comment.