Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ColorPicker not support form disabled #45978

Merged
merged 1 commit into from Nov 21, 2023

Conversation

RedJue
Copy link
Member

@RedJue RedJue commented Nov 21, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix ColorPicker not support form disabled
🇨🇳 Chinese 修复颜色选择器不支持表单组件的禁用问题

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 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

  • Add support for disabled context to ColorPicker component (link, link, link, link, link, link)
  • Import DisabledContext from config-provider component and use it to get the contextDisabled value (link, link)
  • Merge contextDisabled with disabled prop using nullish coalescing operator (??) and store the result in mergedDisabled variable (link)
  • Use mergedDisabled instead of disabled in useMergedState hook, ColorPickerPanel component, ColorPickerInput component, and onOpenChange callback of Trigger component (link, link, link, link)
  • Prevent opening or closing the popup, triggering the onOpenChange callback, or changing the input value when the component is disabled (link, link, link)
  • Update form test cases and demo to include ColorPicker component (link, link, link, link, link, link)
    • Import ColorPicker component from color-picker component in test and demo files (link, link, link)
    • Add Form.Item with ColorPicker component in test case that checks values and validations of various components (link)
    • Add ColorPicker component with disabled prop in test case that toggles disabled state of various components (link)
    • Add Form.Item with ColorPicker component in demo example of form with disabled components (link)
  • Reorder import statements in form test file according to ESLint rule import/order (link)

Copy link

stackblitz bot commented Nov 21, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Nov 21, 2023

Preview Is ready

Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 321.44 KB (-180 B 🔽)
./dist/antd-with-locales.min.js 367.26 KB (+230 B 🔺)

Copy link

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.

Latest deployment of this branch, based on commit 6636942:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

argos-ci bot commented Nov 21, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 change Nov 21, 2023, 6:17 AM

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (aee10c8) 100.00% compared to head (6636942) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #45978   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          700       700           
  Lines        11847     11849    +2     
  Branches      3157      3158    +1     
=========================================
+ Hits         11847     11849    +2     

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

@zombieJ zombieJ merged commit 4baef31 into master Nov 21, 2023
101 checks passed
@zombieJ zombieJ deleted the fix-color-picker-form-disabled branch November 21, 2023 06:28
@zombieJ zombieJ mentioned this pull request Nov 22, 2023
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants