Repository navigation
fix: do not trigger onStep when readOnly or disabled - #764
Conversation
|
@mokshupadhyay is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. Walkthrough
Changes步进状态保护
Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
|
Hi @zombieJ, the CI workflows on this PR are waiting for approval to run (first contribution to this repo). Could you approve them when you have a moment, and take a look at the change? Happy to adjust anything. Thanks! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
=======================================
Coverage 96.16% 96.16%
=======================================
Files 6 6
Lines 365 365
Branches 103 104 +1
=======================================
Hits 351 351
Misses 14 14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
* fix(input-number): do not trigger onStep when readOnly or disabled (react-component/input-number#764) * chore(sync): advance color-picker, input-number, notification cursor to cd0412adc7, 2af2f5cd4f, 8e4f4226d0 --------- Co-authored-by: yanyubot <356405855+yanyubot@users.noreply.github.com>
onStepis called when the input isreadOnlyordisabled, although the value can't change:With a handler held down it repeats on every tick, and
disableddoes the same. The README describesonStepas "Triggered when the value changes by step", andonChangeis already suppressed in both states.onInternalSteponly checked the min/max bounds; it now returns early whenreadOnly || disabled.Test: an
it.eachoverreadOnlyanddisabledintests/props.test.tsxcovering the handler's mouseDown and ArrowUp/ArrowDown; 2 of the new cases fail without the change. The full suite (192 tests) andtscpass, and lint has no errors.An AI coding assistant (Claude Code) helped me find and fix this; I reviewed the change and the tests.
Summary by CodeRabbit