You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: prevent stale normalization after controlled value updates - #755
Typing 1。 schedules normalization to 1.. If the controlled value changes to 2 before that callback runs, the stale normalization can overwrite the displayed value and emit an outdated onChange.
This fix invalidates pending normalization when a controlled update replaces the typed value, while preserving normal behavior when the parent echoes the value received through onChange.
Includes regression tests for controlled updates, zero and empty values, stale callbacks, and continued normalization in controlled and uncontrolled modes.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 23ecf40e-29e8-42d1-bf1f-ee8dc2f64a8b
Commits
Reviewing files that changed from the base of the PR and between 96b0e4c and 4cda1bd.
Files selected for processing: 1
src/InputNumber.tsx
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
No actionable merge-blocking risk remains in the reviewed change.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
标题“fix: prevent stale normalization after controlled value updates”描述了本 PR 的主要变更:受控 value 更新后,使过期的输入规范化任务失效。原始摘要显示,src/InputNumber.tsx 在受控 value 与当前输入解析值不同时递增输入更新标识,使待执行的规范化任务失效;新增的 tests/normalizatio…
Docstring Coverage
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
标题“fix: prevent stale normalization after controlled value updates”描述了本 PR 的主要变更:受控 value 更新后,使过期的输入规范化任务失效。原始摘要显示,src/InputNumber.tsx 在受控 value 与当前输入解析值不同时递增输入更新标识,使待执行的规范化任务失效;新增的 tests/normalization.test.tsx 覆盖了该行为。标题与变更集及 PR 目标一致,且简洁明确。
Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install timed out. The project may have too many dependencies for the sandbox.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the discussion in #751.
Typing
1。schedules normalization to1.. If the controlledvaluechanges to2before that callback runs, the stale normalization can overwrite the displayed value and emit an outdatedonChange.This fix invalidates pending normalization when a controlled update replaces the typed value, while preserving normal behavior when the parent echoes the value received through
onChange.Includes regression tests for controlled updates, zero and empty values, stale callbacks, and continued normalization in controlled and uncontrolled modes.
Summary by CodeRabbit
onChange与onInput会按预期顺序触发。