mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.53k stars 1.31k forks source link

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

Closed Nithinmon-D closed 2 months ago

Nithinmon-D commented 2 months ago

Steps to reproduce

No response

Current behavior

Scenario 1:

Scenario 2:

Expected behavior

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:

arthurbalduini commented 2 months ago

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

Nithinmon-D commented 2 months ago

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 (

); } image

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

arthurbalduini commented 2 months ago

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.

Nithinmon-D commented 2 months ago

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[bot] commented 2 months ago

:warning: 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.

LukasTy commented 2 months ago

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.