Skip to content
Browse files

Fixes failing Text Field unit tests in IE. Listens for focusin/focuso…

…ut instead of focus/blur.
  • Loading branch information...
1 parent 4969e36 commit 8c2c283cd2502037a2d0e6501fe6769a7932e8d7 Tom Dale committed Jun 3, 2011
Showing with 14 additions and 4 deletions.
  1. +14 −4 frameworks/core_foundation/mixins/template_helpers/text_field_support.js
View
18 frameworks/core_foundation/mixins/template_helpers/text_field_support.js
@@ -49,8 +49,13 @@ SC.TextField = SC.TemplateView.extend(
var input = this.$input();
input.val(this._value);
- SC.Event.add(input, 'focus', this, this.focusIn);
- SC.Event.add(input, 'blur', this, this.focusOut);
+ if (SC.browser.msie) {
+ SC.Event.add(input, 'focusin', this, this.focusIn);
+ SC.Event.add(input, 'focusout', this, this.focusOut);
+ } else {
+ SC.Event.add(input, 'focus', this, this.focusIn);
+ SC.Event.add(input, 'blur', this, this.focusOut);
+ }
input.bind('change', function() {
self.domValueDidChange(SC.$(this));
@@ -161,8 +166,13 @@ SC.TextFieldSupport = /** @scope SC.TextFieldSupport */{
input.val(this._value);
- SC.Event.add(input, 'focus', this, this.focusIn);
- SC.Event.add(input, 'blur', this, this.focusOut);
+ if (SC.browser.msie) {
+ SC.Event.add(input, 'focusin', this, this.focusIn);
+ SC.Event.add(input, 'focusout', this, this.focusOut);
+ } else {
+ SC.Event.add(input, 'focus', this, this.focusIn);
+ SC.Event.add(input, 'blur', this, this.focusOut);
+ }
},
focusIn: function(event) {

0 comments on commit 8c2c283

Please sign in to comment.
Something went wrong with that request. Please try again.