From 4819d42f85abd7fe7ab3d87468849b9b450a2d74 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 20 Jun 2012 17:28:26 -0700 Subject: [PATCH] no longer need to blur in a settimeout because dropdown and searchfield are now detached. possibly fixes #132 --- select2.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/select2.js b/select2.js index 4c7c6c10..5160bf19 100755 --- a/select2.js +++ b/select2.js @@ -935,16 +935,11 @@ }, blur: function () { - /* we do this in a timeout so that current event processing can complete before this code is executed. - this allows tab index to be preserved even if this code blurs the textfield */ - window.setTimeout(this.bind(function () { - this.close(); - this.container.removeClass("select2-container-active"); - this.dropdown.removeClass("select2-drop-active"); - this.clearSearch(); - this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); - this.search.blur(); - }), 10); + this.close(); + this.container.removeClass("select2-container-active"); + this.dropdown.removeClass("select2-drop-active"); + this.clearSearch(); + this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); }, focusSearch: function () {