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: using valueUpdate does not listen for change anymore #47

Closed bago closed 8 years ago

bago commented 9 years ago
              if (allBindingsAccessor().valueUpdate) {
                    /*jslint unparam:true*/
                    this.on(element, 'spin', function (ev, ui) {
                        value.value(ui.value);
                    });
                    /*jslint unparam:false*/
                } else {
                    this.on(element, 'change', function () {
                        value.value($(element)[widgetName]('value'));
                    });
                }

If you bind on "spin" you receive only spin notifications while you don't get any event on mouse "wheel" or simple keyboard "change" (enter/focusout after writing anything).

I guess the fix is to always liste on change but also add the spin event when you declare on of the other parameters.

the "valueUpdate" from "value" binding supports string or an array of events to listen. Maybe a good option would be to support something similar, so that it is more futureproof and you can specifically bind to spin and change or spin and keypress depending on your preferences.

bago commented 8 years ago

It seems you fixed it in main "head" code but latest 2.2.2 release doesn't contain the fix, yet. Any chance to have a new release?