Hi all,
Help! I have found another jQuery UI spinner problem

that affects all browsers and is present in milestone 8. I'm hoping someone with a bit more knowledge can give me a workaround for this (please!), until a fix is issued...
\Edit - If you have a spinner and interrupt the spin process with a
dialog box e.g. on blur from the previous field, or on focus of the
spinner, when the dialog is closed the spinner continues the spin
process as if the mouse was held down on the spin button, like an
infinite loop
.
I have created a jsfiddle that illustrates the point, consisting of 2 spinners and a confirm dialog in the change event.
Press one of the first spinner's buttons (either will do), and then do the same with the second spinner (without clicking anywhere else in the meantime). The confirm dialog makes the second spinner get stuck into a loop, constantly incrementing/decrementing. Clicking one of the spin buttons on the broken spinner corrects the state and things return to normal.
I have tried disabling the other spinners before the confirm is displayed, then re-enabling them after, in the hope it would clear the state, but that doesn't work.
In my situation I am using spinners on an ordering form. I use the confirm for a maximum quantity check: if the user confirms then the value is allowed, otherwise it's set back to the previous value.
I tried putting the confirm into the spin event, but this doesn't fire when the user updates the input field usign the keyboard.
I also tried it in the stop event, which fires after every mouse/key press. However this didn't work well as the maximum quantity of my spinners is 999 and the confirm is displayed at varying values that are all quite low e.g. 12. So, if the user wants to enter 130 they would get the confirm dialog when they enter the 3, which would not be expected behaviour. Note that this may end up being my workaround, as this scenario is the least likely to occur.
I also tried setting a flag to check in the spin event, so that the second spinner's spin can be cancelled. This does work and prevents it spinning, but as soon as the flag is unset the problem occurs. Applying focus and blus to the second spinner (or any other for that matter) doesn't help, neither does applying blur to the actual spinner buttons.
I thought it should be straightforward enough to programatically make the spinner think that on of its buttons have been pressed, but I haven't been successful.
Any suggestions anybody? Surely it's reasonable to put a confirm in the change event?
Thanks,
Ian