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 slider component disabled status in form #43142

Merged
merged 4 commits into from Jun 24, 2023
Merged

fix slider component disabled status in form #43142

merged 4 commits into from Jun 24, 2023

Conversation

Starpuccino
Copy link
Contributor

@Starpuccino Starpuccino commented Jun 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

#43140

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix Slider component disabled state in form
🇨🇳 Chinese 修复Slider组件在Form中的禁用状态

☑️ 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

🤖 Generated by Copilot at 5dd6cb3

Enhanced Slider component to support disabling functionality. Added DisabledContext and disabled prop to components/slider/index.tsx.

🔍 Walkthrough

🤖 Generated by Copilot at 5dd6cb3

  • Add disabled prop to Slider component to allow manual disabling (link)
  • Use DisabledContext to get the disabled state from the parent component (link, link)
  • Merge the disabled prop and the DisabledContext value to determine the final disabled state of the slider (link, link)
  • Pass the merged disabled state to the rc-slider component (link)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2023

@@ -114,6 +116,8 @@ const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps>
} = props;

const { getPrefixCls, direction, getPopupContainer } = React.useContext(ConfigContext);
const contextDisabled = React.useContext(DisabledContext);
Copy link
Member

Choose a reason for hiding this comment

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

Could you help to add test case about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test case和页面demo有重叠,所以我同时改动了demo。
如果这影响到了发布规范,我可以撤销有关demo的改动。

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (fb28fd2) 100.00% compared to head (873b2b7) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #43142   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          648       648           
  Lines        10963     10965    +2     
  Branches      2976      2977    +1     
=========================================
+ Hits         10963     10965    +2     
Impacted Files Coverage Δ
components/slider/index.tsx 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@afc163 afc163 merged commit 5c350a8 into ant-design:master Jun 24, 2023
52 checks passed
@PeachScript PeachScript mentioned this pull request Jun 25, 2023
20 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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants