Open hardnold opened 2 years ago
It might make sense to not fire change
and set
if the slider values did not change in an interaction. This already applies on calling the set
method. (this would be a breaking change)
From my perspective it would indeed make sense to always fire set (even if the value didn't change), since the value gets set no matter what the value is. But for the change event it would make sense to only fire it if the value actually has changed.
There are two ways to return preivious value in events. That two way explained clearly in this article. Click here to see
This is more of a feature request rather than an issue.
It would be great if the slider would return also the previous value when an event gets triggered. Then one could check for a value change and only if values have changed, perform an action (like an ajax request) - similar to the state update procedure in react.
Currently one has to store and update the previous value in a global var to check the value in an event handler since the change event gets triggered even if the value hasn't changed.