react-component / react-component/slider

unexpected value change on mouse up when using smooth handle

Open
#646 1 comment 4 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

smoothbad

When adding transition to handle and track to have a smooth movement, things are becoming a bit buggy.
When you click the track, it moves the handle to this position and updates the value. But, when the handle has transition, it just stops moving when leaving the mouse click.

Here it is on CodeSandbox.

It looks like onMouseUp depends on the actual current position, and not on the final position. There is no reason to do it. It should actually store the position in another place (rather on the element itself), and when leaving the mouse hold, read the position from that value.

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

Reproduce the issue in the linked CodeSandbox, starting with src/App.js and the slider's mouse-up behavior. Verify the handle reaches the clicked position and that releasing the mouse preserves the intended final value even while a transition is active.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.