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

onChange called when opening the picker #1362

Closed
eliseidanciu opened this issue Oct 23, 2019 · 4 comments
Closed

onChange called when opening the picker #1362

eliseidanciu opened this issue Oct 23, 2019 · 4 comments

Comments

@eliseidanciu
Copy link

eliseidanciu commented Oct 23, 2019

Environment

Tech Version
@material-ui/pickers 3.2.7
material-ui 4.5.1
React 16.8.6
Browser chrome
Peer library moment 2.24.0

Steps to reproduce

  1. set initial date to null
  2. disable today date
  3. set prop variant="inline"
  4. click on the datepicker to open it (don't select a date)

Expected behavior

TextField remains empty until a date is selected

Actual behavior

onChange is called passing the pre-selected date as a parameter (behaviour is similar to onOpen prop)

Live example

https://codesandbox.io/s/old-moon-853mg

@netcoding87
Copy link

netcoding87 commented Oct 24, 2019

Funny, yesterday we encountered the same issue. But not with setting the shouldDisableDate. Instead we set the maxDate property to a date in the past.

Live example

https://codesandbox.io/s/objective-proskuriakova-3qfnh

@YunitsynNikita
Copy link

Same issue

@YunitsynNikita
Copy link

This is the same post #1300, but still... Can we just open picker without selecting first allowed date?

@dmtrKovalenko
Copy link
Member

@YunitsynNikita no. If your date is disabled we cannot render it as selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants