istvan-ujjmeszaros / bootstrap-touchspin

A mobile and touch friendly input spinner component for Bootstrap.
Other
500 stars 155 forks source link

touchspin.on.stopSpin doesn't fire using mousewheel #35

Closed RavenHursT closed 1 year ago

RavenHursT commented 10 years ago

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.

istvan-ujjmeszaros commented 10 years ago

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).

RavenHursT commented 10 years ago

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