fix: ColorPicker not support form disabled #45978
Merged
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.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖[deprecated] Generated by Copilot at 6636942
This pull request improves the
ColorPicker
component to respect the disabled context from the config-provider, and adds it to the form test cases and demo. It also fixes some ESLint issues in the import statements.🔍 Walkthrough
🤖[deprecated] Generated by Copilot at 6636942
ColorPicker
component (link, link, link, link, link, link)DisabledContext
fromconfig-provider
component and use it to get thecontextDisabled
value (link, link)contextDisabled
withdisabled
prop using nullish coalescing operator (??) and store the result inmergedDisabled
variable (link)mergedDisabled
instead ofdisabled
inuseMergedState
hook,ColorPickerPanel
component,ColorPickerInput
component, andonOpenChange
callback ofTrigger
component (link, link, link, link)onOpenChange
callback, or changing the input value when the component is disabled (link, link, link)ColorPicker
component (link, link, link, link, link, link)ColorPicker
component fromcolor-picker
component in test and demo files (link, link, link)Form.Item
withColorPicker
component in test case that checks values and validations of various components (link)ColorPicker
component withdisabled
prop in test case that toggles disabled state of various components (link)Form.Item
withColorPicker
component in demo example of form with disabled components (link)