Skip to content

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

Closed
@joshkel

Description

@joshkel

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

Metadata

Metadata

Assignees

Labels

component: sliderThis is the name of the generic UI component, not the React module!package: material-uiSpecific to @mui/materialregression 🐛A bug, but worse

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions