Skip to content

Conversation

@simonguo
Copy link
Member

@simonguo simonguo commented Dec 5, 2025

fix: #4394

@codesandbox
Copy link

codesandbox bot commented Dec 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 5, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rsuite-main Error Error Dec 10, 2025 6:16am
rsuite-storybook Error Error Dec 10, 2025 6:16am
rsuite-v5 Error Error Dec 10, 2025 6:16am

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.49%. Comparing base (e295873) to head (045441d).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4444      +/-   ##
==========================================
+ Coverage   94.47%   94.49%   +0.01%     
==========================================
  Files         559      559              
  Lines       13740    13795      +55     
  Branches     4081     4106      +25     
==========================================
+ Hits        12981    13035      +54     
- Misses        687      688       +1     
  Partials       72       72              
Flag Coverage Δ
chromium 94.48% <100.00%> (+<0.01%) ⬆️
firefox 94.49% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the onChange callback was not being invoked when the reset() method is called on a controlled form. The fix ensures that parent components can properly track form state changes when a reset occurs.

Key Changes:

  • Added onChange callback invocation in the reset() method when form is reset to default values
  • Added comprehensive test coverage for this behavior with controlled forms

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Form/Form.tsx Modified the reset() method to call onChange with the reset value before calling onReset, ensuring controlled forms properly notify parent components of state changes
src/Form/test/Form.spec.tsx Added new test case and imported necessary testing utilities (vi, FormInstance) to verify onChange is called when reset() is invoked on a controlled form

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonguo simonguo merged commit acb0e59 into main Dec 10, 2025
19 of 23 checks passed
@simonguo simonguo deleted the fix/form-reset-controlled-issue-4394 branch December 10, 2025 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Form.reset() is not resetting fields (?)

2 participants