Skip to content

Slider: max and customSteps dont play well together #5833

@mdujava

Description

@mdujava

In Slider, specifying max lower then 100 and customSteps will not show as intended.

first slider specify both, second only max is specified.

image

 const freq_steps = [
    { value: 0, label: "A" },
    ...
    { value: 4, label: "E", isLabelHidden: true },
    { value: 5, label: "F" }
  ];
...
// labels are shown, but max is ignored 
  <Slider
      onChange={onChangeFrequency}
      value={frequencyOfTask}
      max={5}
      showTicks
      customSteps={freq_steps}
  />
// max is set correct, but no labels
 <Slider
      onChange={onChangeFrequency}
      value={frequencyOfTask}
      max={5}
      showTicks
  />

https://codesandbox.io/s/hopeful-nash-38mnu?file=/index.js

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions