bootstrap-touchspin icon indicating copy to clipboard operation
bootstrap-touchspin copied to clipboard

touchspin.on.stopSpin doesn't fire using mousewheel

Open RavenHursT opened this issue 9 years ago • 2 comments

The events example here: http://www.virtuosoft.eu/code/bootstrap-touchspin/ shows how when you use the mouse wheel (or scroll touchpad on a macbook) to change the value, the events are not firing. The only events that fire are the min and max events.

I wrote a text in my local app that shows that change is properly being fired.

Problem w/ the current functionality is that, IFAIK, there's no way to use this w/ AJAX calls. If observing the change event, you'll generate multiple calls for each "step" and the on.stopSpin event doesn't fire at all, so I'm actually rather confused as to why it's called on.stopSpin in the first place.

RavenHursT avatar Aug 25 '14 22:08 RavenHursT

Unfortunately the mouse wheel is not spinning and there is no mousewheel start/stop event handlers, so you need a workaround, like this one: http://stackoverflow.com/a/3515490/504270

I can fire the stopspin event when using the mousewheel, but it will be the same as using the change event (the spinning starts when you press the up/down buttons, and stops when releasing it or when the value is reaching the minimum/maximum allowed value).

istvan-ujjmeszaros avatar Aug 28 '14 23:08 istvan-ujjmeszaros

Yeah.. exactly, you'd have to use a configurable event "delay" handing mechanism, similar to how hoverIntent works: http://cherne.net/brian/resources/jquery.hoverIntent.html

RavenHursT avatar Aug 29 '14 00:08 RavenHursT