react-component / react-component/slider

Setting max to 0 does not properly set the slider to 0

Open
#453 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'm using the slider in a way where I first set the slider's max to 0, and immediately thereafter set the value to 0 as well.

I'd expect the slider to be at 0, but it does not look to be. I understand this might happen because both max and min are at 0, so I'd suggest that when this is the case, the slider handle is set at the 0 position to the left.

Here's the reproduction:
https://codesandbox.io/s/628pvx5w8n

Set the slider to any value, then click the button to see it getting stuck at that place.

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, then trace the slider's max and value handling in the repository. Reproduce the case where both are set to 0 and verify that the handle moves to the leftmost position when the fix is complete.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.