Skip to content

Conversation

@simonguo
Copy link
Member

@simonguo simonguo commented Dec 7, 2025

  • Add pickerType prop to PickerToggleTrigger for data-picker attribute
  • Keep name prop for HTML form integration
  • Update all picker components to use pickerType instead of name
  • Fix issue The props aren't rendering properly, and the form's styling is off. #4440 where Form.Control name overrides data-picker value
  • Add tests to verify data-picker attribute is correct with custom name prop

Fixes #4440

…tribute

- Add pickerType prop to PickerToggleTrigger for data-picker attribute
- Keep name prop for HTML form integration
- Update all picker components to use pickerType instead of name
- Fix issue #4440 where Form.Control name overrides data-picker value
- Add tests to verify data-picker attribute is correct with custom name prop

Fixes #4440
@codesandbox
Copy link

codesandbox bot commented Dec 7, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 7, 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 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
rsuite-main Ready Ready Preview Comment Dec 7, 2025 10:20am
rsuite-storybook Ready Ready Preview Comment Dec 7, 2025 10:20am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rsuite-v5 Ignored Ignored Preview Dec 7, 2025 10:20am

@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.48%. Comparing base (3a9f86e) to head (abcf1e1).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4452   +/-   ##
=======================================
  Coverage   94.47%   94.48%           
=======================================
  Files         559      559           
  Lines       13740    13740           
  Branches     4080     4080           
=======================================
+ Hits        12981    12982    +1     
+ Misses        687      686    -1     
  Partials       72       72           
Flag Coverage Δ
chromium 94.48% <100.00%> (+<0.01%) ⬆️
firefox 94.47% <100.00%> (ø)

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 issue #4440 by separating the pickerType prop from the name prop in PickerToggleTrigger. Previously, the name prop was used for both the data-picker HTML attribute and form integration, which caused conflicts when Form.Control passed a custom name prop. The fix introduces a dedicated pickerType prop specifically for the data-picker attribute while preserving the name prop for proper HTML form integration.

  • Added pickerType prop to PickerToggleTrigger for the data-picker attribute
  • Updated all picker components to use pickerType instead of name for the data-picker attribute
  • Added comprehensive tests to verify data-picker attribute remains correct when custom name prop is provided

Reviewed changes

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

Show a summary per file
File Description
src/internals/Picker/PickerToggleTrigger.tsx Added pickerType prop definition and separated it from name prop for independent control of data-picker attribute and form name
src/TreePicker/TreePicker.tsx Changed from name="tree" to pickerType="tree"
src/SelectPicker/SelectPicker.tsx Changed from name="select" to pickerType="select"
src/MultiCascader/MultiCascader.tsx Changed from name="multi-cascader" to pickerType="multi-cascader"
src/InputPicker/InputPicker.tsx Changed from name={multi ? 'tag' : 'input'} to pickerType={multi ? 'tag' : 'input'}
src/DateRangePicker/DateRangePicker.tsx Changed from name="date-range" to pickerType="date-range"
src/DatePicker/DatePicker.tsx Changed from name="date" to pickerType="date"
src/CheckTreePicker/CheckTreePicker.tsx Changed from name="check-tree" to pickerType="check-tree"
src/CheckPicker/CheckPicker.tsx Changed from name="check" to pickerType="check"
src/Cascader/Cascader.tsx Changed from name="cascader" to pickerType="cascader"
src/TagPicker/test/TagPicker.spec.tsx Added test to verify data-picker="tag" attribute is preserved with custom name prop
src/TagInput/test/TagInput.spec.tsx Added test to verify data-picker="tag" attribute is preserved with custom name prop
docs/pages/components/form/fragments/status.md Updated form field names to be more descriptive and consistent

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

@simonguo simonguo merged commit fcfd229 into main Dec 7, 2025
23 of 27 checks passed
@simonguo simonguo deleted the fix/picker-data-attribute-with-form-name branch December 7, 2025 11:04
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.

The props aren't rendering properly, and the form's styling is off.

2 participants