-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[fields] Allow to override the separator between the start and the end date in all range fields #12174
[fields] Allow to override the separator between the start and the end date in all range fields #12174
Conversation
0bb6524
to
aad4df2
Compare
@@ -154,6 +151,9 @@ const MultiInputDateRangeField = React.forwardRef(function MultiInputDateRangeFi | |||
const separatorProps = useSlotProps({ | |||
elementType: Separator, | |||
externalSlotProps: slotProps?.separator, | |||
additionalProps: { |
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.
I also applied the new prop to the multi input range fields because IMHO it makes the DX more consistent (even though people could use slotProps.fieldSeparator.children
to achieve the same behavior.
Note that the old DX still works.
overridesResolver: (props, styles) => styles.separator, | ||
}, | ||
)({}); | ||
const MultiInputDateRangeFieldSeparator = styled(Typography, { |
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.
One less component in the tree 👌
docs/data/date-pickers/custom-field/MultiInputFieldSeparatorSlotProps.js
Outdated
Show resolved
Hide resolved
@@ -49,6 +49,12 @@ You can manually add an `endAdornment` if you want your range picker to look exa | |||
This adornment is purely decorative, the focus remains on the field when the picker is opened. | |||
::: | |||
|
|||
### Change the separator of range fields [<span class="plan-pro"></span>](/x/introduction/licensing/#pro-plan 'Pro plan') |
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.
I moved this one below the introduction of the single input range fields since it uses them
aad4df2
to
95db04c
Compare
95db04c
to
653cb7a
Compare
Deploy preview: https://deploy-preview-12174--material-ui-x.netlify.app/ Updated pages: |
653cb7a
to
a8a1c6f
Compare
a8a1c6f
to
ef5143d
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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.
Great addition! 👏
Nice work. 💯
WDYT, would it make sense to cherry-pick
it to v6
? 🤔
docs/data/date-pickers/custom-field/MultiInputFieldSeparatorSlotProps.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Lukas <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Lukas <[email protected]> Signed-off-by: Flavien DELANGLE <[email protected]>
8070e2d
to
e21466e
Compare
I would say no since we are releasing v7 this week |
Makes sense, but on the other hand, let's not forget, that users tend to stick to a previous major for quite some time... 🙈 |
…d date in all range fields (mui#12174) Signed-off-by: Flavien DELANGLE <[email protected]> Co-authored-by: Lukas <[email protected]>
Closes #8369
Demo preview