zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
891 stars 232 forks source link

Clicking bar always snaps to max value #112

Closed B-Reif closed 4 years ago

B-Reif commented 7 years ago

My slider is always set to the max value on click, no matter where on the bar I click. Resizing the window fixes the issue.

https://giphy.com/gifs/xT39Dn7OvZYUJVYVRS/html5

I suspect this is because the slider is inside of a menu that slides in, so it's in a rather different position than it was at render time.

I'd rather not wait until the menu has slid in to render the slider. Could the slider call _handleResize automatically on clicks? Or could the slider expose _handleResize to the application so we can force a recalc when needed?

You can also recreate this (or similar issues) by mucking around with the slider's sizing/position CSS in the inspector before using it.

deadghost commented 7 years ago

Similar issue. Clicking the min-value handle snaps the max-value handle to the max. I'm using an older version though so can't say if it's been resolved since.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.