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] Is there a way to control the step size sections other than minutes for the field components #13732

Open
xxKeefer opened this issue Jul 5, 2024 · 7 comments
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ v8.x

Comments

@xxKeefer
Copy link

xxKeefer commented Jul 5, 2024

The problem in depth

i can see the prop for minutesStep for https://next.mui.com/x/api/date-pickers/single-input-date-time-range-field/
but i want to control the step size for the other sections, specifically the seconds section. Is there a way to do that?

Your environment

`npx @mui/envinfo`
  System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 20.9.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.10.5 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Chromium (126.0.2592.87)
  npmPackages:
    react: ^18.3.1 => 18.3.1
    react-dom: ^18.3.1 => 18.3.1

Search keywords: mui-x-date-picker field-components
Order ID: 89424

@xxKeefer xxKeefer added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jul 5, 2024
@LukasTy
Copy link
Member

LukasTy commented Jul 5, 2024

Hello, @xxKeefer.
Thank you for creating this issue. 🙏
The minutesStep prop is somewhat of a legacy thing that we could consider for deprecation.
The following behavior for field steps is implemented, hence, a less granular way of stepping is possible with PageUp and PageDown.

To better understand the use case, could you provide a bit more information about your requirement?
What specific configuration do you need and why? 🤔

P.S. The Picker (DigitalClock) components support a timeSteps prop to fine-tune the steps generated in the view.

We could consider using timeSteps to control both the generated view as well as the field stepping behavior.
The only problem and unknown is the a11y question—I'm not sure if this wouldn't be a problem for screen reader users, where they would get a bit of unexpected behavior being used to regular stepping. 🤔

@LukasTy LukasTy added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 5, 2024
@LukasTy LukasTy changed the title [question] Is there a way to control the step size sections other than minutes for the field components [pickers] Is there a way to control the step size sections other than minutes for the field components Jul 5, 2024
@xxKeefer
Copy link
Author

xxKeefer commented Jul 8, 2024

I think you are right with the a11y issues, it's not something my team considered. We are producing a set of reporting dashboard to display traffic data. the data is aggregated on 15min, 5min, 1min and 20sec time windows. We allow our users to seek through the data of time and want to step in those increments.

Our user base is a kind of small targeted set of users that are mostly traffic control people, i don't think we have considered the a11y of it as much because it is unlikely our users will need the use of a11y tools.

Even considering that it might be less than optimal for a11y this is something we will probably want to override. I've tried to provide new functions to the various onKey props but it doesn't seem to override the default behavior.

In this demo i have tried to just override the function to do a noop but i hasn't changed any behavior. Am i missing something?

@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 Jul 8, 2024
@LukasTy
Copy link
Member

LukasTy commented Jul 8, 2024

In this demo i have tried to just override the function to do a noop but i hasn't changed any behavior. Am i missing something?

Your sandbox is probably private, I can't access it.

Even considering that it might be less than optimal for a11y this is something we will probably want to override. I've tried to provide new functions to the various onKey props but it doesn't seem to override the default behavior.

Thank you for sharing more information about your use case. 🙏
We could add the option for the field component to use timeSteps for the arrow editing.
We'd only be in an interesting spot regarding the PageUp and PageDown navigation as it might no longer make sense. 🤷

I'm adding this issue to our grooming board to discuss a solution. 😉

@LukasTy LukasTy removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 8, 2024
@xxKeefer
Copy link
Author

xxKeefer commented Jul 8, 2024

You're right sorry about that forgot to change the perms. the demo should be unlisted now.

Yeah I can see how the PageUp and PageDown stepping by five might not make sense with a step size prop specified. Perhaps if a step size is specified, both the ArrowUp/ArrowDown and PageUp/PageDown would use the specified step size? I'm not a a11y expert though. I'll leave it with you guys then. Keen to hear the outcome.

@LukasTy
Copy link
Member

LukasTy commented Jul 9, 2024

You're right sorry about that forgot to change the perms. the demo should be unlisted now.

I'm still getting a 404 error. 🤔
Screenshot 2024-07-09 at 08 54 16

@xxKeefer
Copy link
Author

xxKeefer commented Jul 9, 2024

🤦🏻 Sorry for the time waste, i didn't hit the move sandbox / confirm unlisted button. I have verified with incognito mode now >.<

@michelengelen michelengelen added the support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ label Jul 15, 2024
@LukasTy
Copy link
Member

LukasTy commented Oct 15, 2024

Using this issue as a host to ditch minutesStep and use timeSteps both in Clock as well as Field components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ v8.x
Projects
None yet
Development

No branches or pull requests

3 participants