-
Notifications
You must be signed in to change notification settings - Fork 1.5k
event: change binding difference between 3.4.2 and 3.5.1 #2530
Copy link
Copy link
Closed
Milestone
Description
With a view model like this:
function ViewModel(){
var self = this;
self.testId = ko.observable(1);
self.setTestId = function () {
alert(self.testId())
}
}
and HTML like:
<select data-bind="value: testId, event: { change: setTestId }">
If you look at this fiddle for 3.4.2: https://jsfiddle.net/Lbkur7sc/6/
and this one for 3.5.1: https://jsfiddle.net/dog5ze18/6/
You'll see that when changing the select value, in 3.4.2, the value in the observable has been updated by the time the setTestId function fires via the change event. In 3.5.1, the old value is in the observable. Is this an intended breaking change? I looked through the release notes and didn't see that noted anywhere. This certainly seems like a bug since, as you can see in the test case, if you get the value of the select at that point, it does not match the observable.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels