I’ve looked through the forum and have seen some others shed light on this but it still does not address the fundamental problem.
If a user is currently dragging the slider pointer I do not want to be blasted with numerous ‘onChange’ events when I am only concerned about the final landing value.
If I add the ‘if this._busy’ code to my onChange handler, then I lose the ability to simply click on the slider and get the new value. I must click on the pointer a second time and then I get a proper event sent to me.
So…
How can I write an ‘onChange’ handler that allows me to ignore the transient events during a user drag event? -AND- Also allows for single direct clicks on the slider to be detected …
Yes. I am using onSlideEnd() as well. That is the event that gets called when using the _busy check.
When you click on the bar at some random location the pointer moves to that location. The _busy check stops the onChange() event from firing. When you click the pointer at that location a second time the onSlideEnd() event gets fired.
There should be a way to click once on the bar and get an onChange() event. Then while sliding the pointer (drag in progress) there should be the ability to ignore the onChange() event.
To get slider value by first click you can use setOnChangeHandler method
Try the next:
slider1.setOnChangeHandler(function(){
console.log(slider1.getValue())
})