Skip to content

fix: Form add change & reset callback#325

Merged
TinaPeach merged 27 commits into
mainfrom
feat-form-add-onChange-event-reset
Jun 6, 2025
Merged

fix: Form add change & reset callback#325
TinaPeach merged 27 commits into
mainfrom
feat-form-add-onChange-event-reset

Conversation

@Evergcj

@Evergcj Evergcj commented May 15, 2025

Copy link
Copy Markdown
Collaborator
  • fix form reset
  • add onChange event for user operation
  • fix radiogroup can not be reset in form

Comment thread packages/arcodesign/components/form/demo/style/mobile.less Outdated
Comment thread packages/arcodesign/components/form/form-item.tsx Outdated
Comment thread packages/arcodesign/components/form/form-item.tsx
Comment thread packages/arcodesign/package-lock.json
@adaex adaex requested a review from Copilot May 30, 2025 09:34

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses three key issues: it fixes the form reset behavior (including for radio groups), adds an onChange event for user interactions, and updates demo/test snapshots accordingly.

  • Updates RadioGroup props to support resetting with null values.
  • Enhances the form API with new initial value and field value management functions.
  • Adjusts snapshot tests and demo examples to incorporate the new “single-line” style and event handlers.

Reviewed Changes

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

Show a summary per file
File Description
packages/arcodesign/components/radio/type.ts Updated RadioGroupProps to allow value to be null.
packages/arcodesign/components/radio/group.tsx Adjusted state and value formatting for radio groups reset.
packages/arcodesign/components/input/index.tsx Modified input type string to include “single-line” suffix.
packages/arcodesign/components/input/test/snapshots/index.spec.js.snap Updated snapshots to reflect the new “single-line” class styling.
packages/arcodesign/components/form/utils.ts Added deepClone and a default value function for form components.
packages/arcodesign/components/form/useForm.ts Introduced new internal methods for setting and getting values.
packages/arcodesign/components/form/type.ts Updated type definitions for form internals and callbacks.
packages/arcodesign/components/form/style/index.less Revised LESS styles to apply “single-line” styles correctly.
packages/arcodesign/components/form/linked-container.tsx Made ts optional in the linked container component.
packages/arcodesign/components/form/index.tsx Passed the onChange prop through to the form instance.
packages/arcodesign/components/form/form-item.tsx Refactored form item internal interactions and event triggers.
packages/arcodesign/components/form/demo/use-form.md Added reset button example in demo.
packages/arcodesign/components/form/demo/index.md Included onChange examples and updated initial values in demo.
packages/arcodesign/components/form/demo/custom-item.md Provided a custom form item demo utilizing the updated form API.
package.json Added a new dependency for lodash.clonedeepwith.
Files not reviewed (1)
  • packages/common-widgets/package-lock.json: Language not supported

Comment thread packages/arcodesign/components/form/type.ts
@codecov

codecov Bot commented May 30, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 91.42857% with 12 lines in your changes missing coverage. Please review.

Project coverage is 89.84%. Comparing base (c14d0d2) to head (5c1732a).
Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
packages/arcodesign/components/form/form-item.tsx 90.47% 6 Missing ⚠️
packages/arcodesign/components/form/useForm.ts 88.67% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
- Coverage   90.11%   89.84%   -0.28%     
==========================================
  Files         141      141              
  Lines        8257     8475     +218     
  Branches     3389     3471      +82     
==========================================
+ Hits         7441     7614     +173     
- Misses        792      834      +42     
- Partials       24       27       +3     

☔ 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.

@github-actions

github-actions Bot commented Jun 5, 2025

Copy link
Copy Markdown

PR Preview Link: https://preview-325-arco-design-mobile.surge.sh

@TinaPeach TinaPeach changed the title Feat form add on change event reset fix: Form add change & reset callback Jun 6, 2025
@TinaPeach TinaPeach merged commit 16c2ffd into main Jun 6, 2025
7 checks passed
@TinaPeach TinaPeach deleted the feat-form-add-onChange-event-reset branch June 6, 2025 07:54
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.

4 participants