gvas / knockout-jqueryui

Knockout bindings for the jQuery UI widgets.
http://gvas.github.com/knockout-jqueryui/
MIT License
103 stars 38 forks source link

Spinner up/down click cannot update ViewModel in real-time #13

Closed BrandonLWhite closed 10 years ago

BrandonLWhite commented 10 years ago

When using the spinner widget, there are 2 different use cases. The default, is to only update the ViewModel when the input loses focus (blur). The other, is to update the VM immediately whenever the value in the spinner changes, through whatever user action (typing, up/down arrow key, page up/down, and mouse click on up/down buttons). knockout-jqueryui works fine with the former, but does not with the latter.

Here is a fiddle that demonstrates the issue: http://jsfiddle.net/LatencyMachine/CPWZe/

And here is a fiddle that demonstrates the proposed fix: http://jsfiddle.net/LatencyMachine/MrySq/

I will follow-up with a pull request containing my proposed fix for your review. Thanks for starting this very useful project.

gvas commented 10 years ago

@BrandonLWhite,

Thanks for the pull request (I'm especially grateful for the tests). I'll make a new release at the end of this week.

Regards gvas