1 year ago

#379567

test-img

Ole Dybedokken

MUI slider not draggable more than one step at a time

So I have a mui slider on my map that changes the year of display data for a specific Layer. However my Mui slider is not "draggable" it only lets me move one step at a time then stops and I have to let go of the slider and then redrag it. Clicking around on it works fine. When setYear changes it runs a function in usememo that changes the layer. I suspect this might be the problem but have can I avoid it?

const handleTimeChange = (event, newValue) => {
    if (newValue !== year) {
      setYear(newValue);
    }
  };
<Slider
        getAriaLabel={() => "Date range"}
        value={year}
        onChange={handleTimeChange}
        valueLabelDisplay="auto"
        sx={{ width: "200px", ml: "20px" }}
        max={2020}
        min={min}
        align="center"
      />

javascript

reactjs

material-ui

mapbox

0 Answers

Your Answer

Accepted video resources