Permalink
Browse files

fix regression issue with hasfocus: loss of dependency tracking in up…

…date function after first run.
  • Loading branch information...
1 parent c420788 commit eba5624bc6db6a65082d924e611d7a94a4327cdd @mbest mbest committed Oct 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/binding/defaultBindings/hasfocus.js
@@ -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
}

2 comments on commit eba5624

Contributor

ah. :-)
thanks!

Owner

You're welcome. Thanks for finding and reporting it. You made it easy for me.

Please sign in to comment.