react-component / react-component/slider

onChange and onAfterChange fires with different values

Open
#600 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

https://codesandbox.io/s/musing-wood-jynu0 here is example

Have a slider with min={6}, max={15}, pushable={3} and allowCross={false} default value is [12, 15].
Click on 14 dot: onChange fires with value [12, 14], onAfterChange with [11, 15].

Actually i think these events should not fires at all, because in this case range 12 to 14 is less than pushable 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

Start with the linked CodeSandbox reproduction and trace how the slider handles onChange and onAfterChange for min=6, max=15, pushable=3, allowCross=false, and the value [12, 15]. Compare the two emitted values when clicking 14, and verify the expected behavior for a range narrower than pushable. Done means the callbacks no longer report inconsistent or unintended values.

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.