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

Slider with marks and step=null gives NaN when using arrow keys off the end #45049

Closed
joshkel opened this issue Jan 17, 2025 · 4 comments · Fixed by #45050
Closed

Slider with marks and step=null gives NaN when using arrow keys off the end #45049

joshkel opened this issue Jan 17, 2025 · 4 comments · Fixed by #45050
Assignees
Labels
bug 🐛 Something doesn't work component: slider This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse

Comments

@joshkel
Copy link
Contributor

joshkel commented Jan 17, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/react-wipr3jaf?file=Demo.tsx
  2. Click the slider at 20°C
  3. Press the right arrow key a few times.

Current behavior

Trying to go off the right edge sets the value to NaN.

Expected behavior

Stop at the right edge.

Context

No response

Your environment

npx @mui/envinfo

  System:
    OS: macOS 15.1.1
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 131.0.6778.265
    Edge: 131.0.2903.147
    Safari: 18.1.1
  npmPackages:
    @emotion/react:  11.14.0 
    @emotion/styled:  11.14.0 
    @mui/base:  5.0.0-beta.68 
    @mui/core-downloads-tracker:  6.4.0 
    @mui/icons-material:  6.4.0 
    @mui/lab:  6.0.0-beta.23 
    @mui/material:  6.4.0 
    @mui/private-theming:  6.4.0 
    @mui/styled-engine:  6.4.0 
    @mui/system:  6.4.0 
    @mui/types:  7.2.21 
    @mui/utils:  6.4.0 
    @mui/x-date-pickers:  7.23.6 
    @mui/x-internals:  7.23.6 
    @mui/x-tree-view:  7.23.6 
    @types/react: ^18.3.18 => 18.3.18 
    react: ^18.3.1 => 18.3.1 
    react-dom: ^18.3.1 => 18.3.1 
    typescript: ^5.7.3 => 5.7.3 

Search keywords: slider nan

@joshkel joshkel added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 17, 2025
joshkel added a commit to joshkel/material-ui that referenced this issue Jan 17, 2025
joshkel added a commit to joshkel/material-ui that referenced this issue Jan 17, 2025
@siriwatknp siriwatknp added bug 🐛 Something doesn't work component: slider This is the name of the generic UI component, not the React module! ready to take Help wanted. Guidance available. There is a high chance the change will be accepted and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 20, 2025
@siriwatknp
Copy link
Member

I'd consider this a bug. Using keyboard arrow should not goes beyond min and max similar to touch action.

@mj12albert mj12albert added package: material-ui Specific to @mui/material and removed ready to take Help wanted. Guidance available. There is a high chance the change will be accepted labels Jan 20, 2025
@ZeeshanTamboli
Copy link
Member

This is also reproducible in the Slider docs under the Restricted Values demo: https://mui.com/material-ui/react-slider/#restricted-values

@ZeeshanTamboli
Copy link
Member

This is a regression from #44537. It works in v6.1.10 but fails in v6.2.0.

@ZeeshanTamboli ZeeshanTamboli added the regression A bug, but worse label Jan 20, 2025
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.

Note

@joshkel 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.

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: slider This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants