Skip to content

Commit

Permalink
fix regression issue with hasfocus: loss of dependency tracking in up…
Browse files Browse the repository at this point in the history
…date function after first run.
  • Loading branch information
mbest committed Oct 15, 2012
1 parent c420788 commit eba5624
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/binding/defaultBindings/hasfocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ko.bindingHandlers['hasfocus'] = {
ko.utils.registerEventHandler(element, "focusout", handleElementFocusOut); // For IE
},
'update': function(element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
if (!element[hasfocusUpdatingProperty]) {
var value = ko.utils.unwrapObservable(valueAccessor());
value ? element.focus() : element.blur();
ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, value ? "focusin" : "focusout"]); // For IE, which doesn't reliably fire "focus" or "blur" events synchronously
}
Expand Down

0 comments on commit eba5624

Please sign in to comment.