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

make slider trigger onChange also on click #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vsandvold
Copy link
Contributor

@vsandvold vsandvold commented Mar 15, 2022

This PR makes the slider call onChange also when the user clicks on the slider track, not just after dragging the slider thumbs.

Problem:
When clicking the slider track, onChange is not called, even though the input values are changed (and onInput is called). This prevents the eg. the search result page from updating the user's search when clicking on a slider filter.

Solution:
Since active is true while the user interacts with the slider, and false afterwards, we can use this state to trigger the onChange callback.

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

Successfully merging this pull request may close these issues.

1 participant