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

[pickers][TimePicker] minutesStep prop not reflecting in UI intervals #14272

Closed
Nithinmon-D opened this issue Aug 20, 2024 · 6 comments
Closed
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module!

Comments

@Nithinmon-D
Copy link

Nithinmon-D commented Aug 20, 2024

Steps to reproduce

No response

Current behavior

Scenario 1:

  • The picker shows time intervals in 5-minute increments instead of 1-minute increments.
  • Manually entering the time using the arrow key and number keypad allows you to set the minutes in 1-minute increments (1, 2, 3, 4, etc.).

Scenario 2:

  • The picker still shows time intervals in 5-minute increments, despite explicitly setting minutesStep to 1.
  • Manually entering the time using the arrow key and number keypad works as expected, allowing you to set the minutes in 1-minute increments.

Expected behavior

  • When rendering the TimePicker with the default settings, the minutesStep should be 1, so the picker should show time intervals in 1-minute increments when clicking on the picker icon.
  • When rendering the TimePicker with minutesStep={1}, the picker should show time intervals in 1-minute increments when clicking on the picker icon.

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: TimePicker

Search keywords:

@Nithinmon-D Nithinmon-D added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 20, 2024
@zannager zannager transferred this issue from mui/material-ui Aug 20, 2024
@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Aug 20, 2024
@arthurbalduini
Copy link
Member

Hello @Nithinmon-D,
I couldn't reproduce the described behaviors. Could you please share an example or a video of the issue ?

@arthurbalduini arthurbalduini changed the title TimePicker Component: minutesStep Prop Not Reflecting in Picker UI Intervals [pickers] TimePicker Component: minutesStep Prop Not Reflecting in Picker UI Intervals Aug 20, 2024
@michelengelen michelengelen changed the title [pickers] TimePicker Component: minutesStep Prop Not Reflecting in Picker UI Intervals [pickers][TimePicker] minutesStep prop not reflecting in UI intervals Aug 20, 2024
@michelengelen michelengelen added bug 🐛 Something doesn't work status: waiting for author Issue with insufficient information component: time picker 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 Aug 20, 2024
@Nithinmon-D
Copy link
Author

Hello @Nithinmon-D, I couldn't reproduce the described behaviors. Could you please share an example or a video of the issue ?

import * as React from 'react';
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { TimePicker } from '@mui/x-date-pickers/TimePicker';

export default function BasicTimePicker() {
return (

<DemoContainer components={['TimePicker']}>



);
}
image

since the minuteStep is 1 the interval should be 1, 2, 3, .... but instead it is 0, 5, 10.....

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Aug 21, 2024
@arthurbalduini
Copy link
Member

arthurbalduini commented Aug 21, 2024

Hello @Nithinmon-D,
Thanks for the details. If I understand your issue correctly, to achieve such behavior you must set the timeSteps prop to have the step interval you wish. In that case, you would set it like:

<TimePicker
  timeSteps={{ minutes: 1 }}
/>

Let us know if it doesn't solve your needs.

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 21, 2024
@Nithinmon-D
Copy link
Author

Hello @Nithinmon-D, Thanks for the details. If I understand your issue correctly, to achieve such behavior you must set the timeSteps prop to have the step interval you wish. In that case, you would set it like:

<TimePicker
  timeSteps={{ minutes: 1 }}
/>

Let us know if it doesn't solve your needs.

tx its worked

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Aug 22, 2024
Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@Nithinmon-D: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 22, 2024
@LukasTy
Copy link
Member

LukasTy commented Sep 5, 2024

Given this confusion, I think that we should unify the behavior of minutesStep and timeSteps and deprecate/drop the minutesStep prop in favor of one option for similar/same thing.
I have added this idea to the v8 preparation issue.

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: pickers This is the name of the generic UI component, not the React module! component: time picker This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

5 participants