Skip to content

Label not rendered in DatePicker field #379

@ppbevilacqua

Description

@ppbevilacqua

Hi, I'm updating my project dependencies, in particular @mui/x-date-pickers from v5 to v7. I've updated also formik-mui-x-date-pickers from 0.0.1 to 1.0.0 (not 2.0.0 because of issue #376.
The previous component with DatePicker as component in formik doesn't show the label passed as props, as documentation says:

<Field
  component={DatePicker}
  label="label"
  name="name"
  textField={{ helperText: 'Helper text' }}
  inputFormat="MM/dd/yyyy"
/>

Since MUI introduced slotProps, I tried a different way to pass the label to my field, and apparentily it works.
So the field working label has this props:

slotProps={{
   textField: {
      label: 'My label',
   }
}} 

I replicated the case on codesandbox: https://codesandbox.io/p/sandbox/hkv2ds

I tried also to write a custom Component just using the DatePicker from @mui/x-date-pickers, with formik props integration.

Could you please help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions