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

[fields] Move the logic of the fields opening to be in the field instead of in the picker #14787

Open
flaviendelangle opened this issue Oct 1, 2024 · 0 comments · May be fixed by #15671
Open
Assignees
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition v8.x

Comments

@flaviendelangle
Copy link
Member

flaviendelangle commented Oct 1, 2024

Part of #13188

Use the new PickersFieldContext and its new onViewToggle (name under discussion in #14606) to move all the opening logic from the picker hooks (useDesktopPicker, useMobileRangePicker etc...) to the field component.

This comes with several benefits:

  • The single input range field will be able to open with an end adornment and the multi input range field when clicking the value
  • All the slots related to the field will be resolved by the field and not by the picker which simplifies the logic
  • No need for useEnrichedRangePickerFieldProps anymore (might need to keep it for v8 depending on the time we have but the goal is to eventually drop this hook)
  • The props received by the fields are no longer tied to MUI APIs, which makes the building of custom hooks a lot simpler.

The main downside I see is that the field include some code that is not needed when used as standalone. But I think the top priority should always be the quality of the pickers over the quality of the field.

Search keywords:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition v8.x
Projects
None yet
2 participants