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

[Timepicker] With null value, after selecting hour default time is current minute of now rather than a more logical default like 00 #24887

Closed
2 tasks done
dborstelmann opened this issue Feb 12, 2021 · 2 comments · Fixed by #27037
Labels
bug 🐛 Something doesn't work component: time picker This is the name of the generic UI component, not the React module!

Comments

@dborstelmann
Copy link
Contributor

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

  1. Pass null to timepicker.
  2. Select hour (defaults to nothing)
  3. Select minute, defaults to whatever minute right now is, which is a strange default, especially considering hour is null to start.

Expected Behavior 🤔

  1. Pass null to timepicker.
  2. Select hour (defaults to nothing)
  3. Select time, defaults to nothing or 00 (0 may be required because I understand changing hour sets a value, I think this new value should not have current time).

Context

When someone adds a new time to an object that doesn't have it, they are unlikely to have minutes defaulting to now. They are usually setting a value that is in the future and likely to be on an hour, or half hour, or maybe 15 minutes. But 0 is a more logical default than now.

@dborstelmann dborstelmann added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 12, 2021
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: timeline This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 14, 2021
@tomas-c
Copy link

tomas-c commented Apr 15, 2021

Another issue with the current time being the default is that it does not respect minutesStep setting. If I set minutesStep=5 the initial value sometimes can default to, for example, 13.

@oliviertassinari oliviertassinari added component: time picker This is the name of the generic UI component, not the React module! and removed component: timeline This is the name of the generic UI component, not the React module! labels Apr 24, 2021
michal-perlakowski added a commit to michal-perlakowski/material-ui that referenced this issue Jun 30, 2021
@michal-perlakowski
Copy link
Contributor

The same applies to seconds when using a Time Picker with seconds.

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

Successfully merging a pull request may close this issue.

4 participants