react-component / react-component/slider

Slider can only move by one step

Open
#968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.1k
Forks
768
Avg merge
11d 22h
Merged PRs (30d)
5

Description

I am using Slider like this:

<Slider 
    range
    className="t-slider"
    min={0}
    max={120}
    step={15}
    marks={Object.fromEntries(range(0, 121, 15).map(t=>[t, formatTimestamp(t, 60)]))}
    value={paragraphLength}
    onChange={(v) => {setParagraphLength(v);}}/>

When dragging the slider, it gets released after a single step, so the user needs to grab it again to drag another step. A similar observation was reported in #363. However, in contrast to the code there, I do not create a Range during render (I do not create it at all).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Slider component and reproduce the provided range configuration: range, min 0, max 120, step 15, marks, and a controlled value. Trace the drag interaction to determine why the handle is released after one step, then verify that dragging can cross multiple steps without recreating a Range during render.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.