Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong placement for elements with negative number #275

Open
shinspiegel opened this issue Sep 27, 2022 · 2 comments
Open

Wrong placement for elements with negative number #275

shinspiegel opened this issue Sep 27, 2022 · 2 comments

Comments

@shinspiegel
Copy link

Description

It appears that some calculation for the position breaks if there are values with a negative number. In special if we have marks defined. With multiple buttons, some of them also break.

CodeSandbox

Minimum Example

Edit zillow/react-slider

@kris-ellery
Copy link
Member

react-slider does not support negative values. We would need to add it as a new feature.

@axelboc
Copy link

axelboc commented Sep 27, 2022

Best way is to set the min/max/step of the slider to whole integer numbers, say 0 to 100 with a step of 1, and then use a scale (e.g. d3-scale's linear scale) to go from your negative domain to the range of the slider and back. You can write a small wrapper component to abstract this complexity away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants