Permalink
Browse files

fix #962 autoselect is called asynchronously after focus()

Fix required as test.aria.widgets.autoselect.programmatic.AutoSelect failed on IE 11,
as .focus() is asynchronous on this browser.

Close #950
  • Loading branch information...
1 parent c7ac938 commit abcae0341b7ec0fc4ec20847b6c73a42801242c1 @fbasso committed Feb 7, 2014
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/aria/widgets/form/TextInput.js
@@ -1184,7 +1184,14 @@ Aria.classDefinition({
textInputField.value = textInputField.value;
if (!fromSelf) {
- this._autoselect();
+ // IE FIX: the focus() can be asynchronous, so let's add a timeout to manage the autoselect
+ aria.core.Timer.addCallback({
+ fn : function() {
+ this._autoselect();
+ },
+ scope : this,
+ delay : 25
+ });
}
},

0 comments on commit abcae03

Please sign in to comment.