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
fix slider component disabled status in form #43142
Conversation
@@ -114,6 +116,8 @@ const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps> | |||
} = props; | |||
|
|||
const { getPrefixCls, direction, getPopupContainer } = React.useContext(ConfigContext); | |||
const contextDisabled = React.useContext(DisabledContext); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ReportPatch coverage:
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
☔ View full report in Codecov by Sentry. |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
#43140
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 5dd6cb3
Enhanced
Slider
component to support disabling functionality. AddedDisabledContext
anddisabled
prop tocomponents/slider/index.tsx
.🔍 Walkthrough
🤖 Generated by Copilot at 5dd6cb3
disabled
prop toSlider
component to allow manual disabling (link)DisabledContext
to get the disabled state from the parent component (link, link)disabled
prop and theDisabledContext
value to determine the final disabled state of the slider (link, link)rc-slider
component (link)