-
-
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
[pickers] Move more field props to the context #16278
[pickers] Move more field props to the context #16278
Conversation
bd4ffba
to
765e2a8
Compare
765e2a8
to
7d6fbd3
Compare
]} | ||
className={clsx(className, slotProps?.layout?.className)} | ||
ref={ref} | ||
sx={mergeSx(providerProps.contextValue.rootSx, slotProps?.layout?.sx)} |
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'm using the context instead of direct prop access so that every component has the same data flow.
But these weird providerProps.xxx
accesses will go away once we have the new structure.
f3b236b
to
40c8435
Compare
40c8435
to
9b9ea88
Compare
@@ -486,12 +513,14 @@ If the updated values do not fit your use case, you can [override them](/x/react | |||
formatDensity='spacious' | |||
selectedSections={selectedSections} | |||
onSelectedSectionsChange={onSelectedSectionsChange} | |||
inputRef={inputRef} |
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.
Did I get this wrong, or should this have a -
in front of it to show the diff change?
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.
It should not
This section says that if you really want to still access those props on the field, then you can duplicate what you pass to the picker and also pass it to the field with slotProps.field
.
It's clearly not something a lot of people should do
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This PR moves all the props that comes directly from the
props
of the pickers and are passed as is to theprops
of the fields.It will help with #16175 because most of those props are not available on multi input range fields.
In this PR
Here are the props impacted:
className
sx
inputRef
name
label
ref
ownerState
(not documented)Follow up
Here are the props we are still drilling:
focused
(handled in [pickers] Move the opening logic to the range fields #16175)readOnly
(handled in [pickers] Move the opening logic to the range fields #16175)