feat(Slider): unify orientation attribute usage#53671
feat(Slider): unify orientation attribute usage#53671thinkasany merged 17 commits intoant-design:nextfrom
Conversation
|
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
👁 Visual Regression Report for PR #53671 Passed ✅
🎊 Congrats! No visual-regression diff found.
|
WalkthroughThis pull request introduces a new feature to the Slider component by adding an 'orientation' attribute. This attribute allows for configuration of the slider's orientation, providing more flexibility in layout design. The changes include updates to the component logic, tests, and documentation to reflect this new feature. Changes
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 466 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
53e4a6c to
7e0439d
Compare
7e0439d to
dc6dda2
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #53671 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 787 788 +1
Lines 14291 14304 +13
Branches 3780 3786 +6
=========================================
+ Hits 14291 14304 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a45fb7b to
b922ddc
Compare
fa29ff3 to
c38785f
Compare
51fa7a3 to
6c3163e
Compare
a1498d7 to
69fc3d2
Compare
| disabled, | ||
| }; | ||
|
|
||
| return <Input ref={composeRef<InputRef>(inputRef, ref)} {...inputProps} />; |
There was a problem hiding this comment.
Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.
f202472 to
f2fc016
Compare
| ): [Orientation, boolean] { | ||
| return useMemo(() => { | ||
| const validOrientation = orientation === 'horizontal' || orientation === 'vertical'; | ||
| let mergedOrientation: Orientation = 'horizontal'; |
8a0e55a to
de92088
Compare
| [['invalid'] as any, ['horizontal', false]], | ||
| ]; | ||
|
|
||
| it.each(testCases)('with args %j should return %s', (params, expected) => { |
components/slider/index.en-US.md
Outdated
| | vertical | If true, the slider will be vertical. Simultaneously existing with orientation, orientation takes priority | boolean | false | | | ||
| | onChangeComplete | Fire when `mouseup` or `keyup` is fired | (value) => void | - | | | ||
| | onChange | Callback function that is fired when the user changes the slider's value | (value) => void | - | | | ||
| | orientation | Orientation | `horizontal` \| `vertical` | `horizontal` | | |
components/slider/index.tsx
Outdated
|
|
||
| const { vertical } = props; | ||
|
|
||
| const { vertical, orientation } = props; |
components/slider/index.tsx
Outdated
|
|
||
| const { vertical, orientation } = props; | ||
| const [, mergedVertical] = useOrientation(orientation, vertical); | ||
| restProps.vertical = mergedVertical; |
There was a problem hiding this comment.
下面都是以 mergedVertical 为准了,不需要这个代码,另外也不应填结构出来的 object,否则有问题很难找。
45a48ce to
92a4e15
Compare


🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
FRC #53328
📝 Change Log