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

[DatePicker] Fix passing clearable prop #30786

Merged
merged 12 commits into from
Feb 14, 2022

Conversation

alisasanib
Copy link
Contributor

@alisasanib alisasanib commented Jan 26, 2022

Demo

Problems:

  • clearable prop did not render the clear button in DesktopDatePicker component and it was only passed to the MobileDatePicker component

Solution:

  • passing clearable and clearText props and rendering clear button on PickersPopper whenever clearable is true

@mui-bot
Copy link

mui-bot commented Jan 26, 2022

Details of bundle changes

@material-ui/lab: parsed: +0.12% , gzip: -0.01% 😍

Generated by 🚫 dangerJS against d0b9af0

@danilo-leal danilo-leal added the component: date picker This is the name of the generic UI component, not the React module! label Jan 26, 2022
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, we are currently moving the pickers in https://github.com/mui-org/material-ui-x so I would propose focusing on some other components at the time being, until the migration settles. The changes for this particular PR look good, only some polish is needed

@alisasanib
Copy link
Contributor Author

Thanks for the comments @mnajdova. I will work on them

@alisasanib alisasanib force-pushed the DatePicker/passing-clearable-prop branch from 0659e00 to a4f3df7 Compare January 29, 2022 16:34
@siriwatknp
Copy link
Member

👋 The migration PR has been merged.

Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)

  1. pull latest master from upstream to your branch
  2. if your PR has changes on the *.md or demo files, you are likely to encounter conflict because all of them have been moved to the new folder.
    2.1 revert the change on those markdown files you did
    2.2 pull latest master from upstream (you should not see conflict)
    2.3 make the changes again at docs/data/material/*
  3. run yarn docs:api
    • you might see the changes in docs/pages/material/api/* if your PR touches some of the components
    • it is okay if there is no changes

If you are struggle with the steps above, feel free to tag @siriwatknp

@alisasanib alisasanib force-pushed the DatePicker/passing-clearable-prop branch from aadd994 to 821a0f0 Compare February 7, 2022 15:32
@alisasanib alisasanib changed the title [DatePicker] passing clearable prop [DatePicker] Fix passing clearable prop Feb 7, 2022
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @alisasanib

@mnajdova
Copy link
Member

mnajdova commented Feb 9, 2022

@flaviendelangle FYI

@zigang93
Copy link

DateRangePicker clearable prop not working mui/mui-x#4503

@wilav-dev
Copy link

wilav-dev commented May 25, 2022

clearable not showing clear button on mobile components

@flaviendelangle
Copy link
Member

Hi,
Thanks for your contribution.

Could you provide a working reproduction, this Codesandbox template might be a good starting point.

@wilav-dev
Copy link

@flaviendelangle
Copy link
Member

We changed the way users can customize the actions on the pickers
See our latest release note for more details
A doc page will soon follow.

Here is your example updated: https://codesandbox.io/s/date-and-time-pickers-forked-j1swd3?file=/src/App.tsx

By the way, I don't think our components ever had an onClear callback, did you find this prop documented somewhere ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DatePicker] 'clearable' prop has no effect.
9 participants