From 56631aa09f19c0ff3ed4417da540f474461e7b0f Mon Sep 17 00:00:00 2001 From: Jason Purcell Date: Mon, 28 Jan 2013 15:01:17 -0500 Subject: [PATCH] adding defensive check for existence of select2 on the target element during the document mousedown/touchend events --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index b242c0c7..18a28d18 100644 --- a/select2.js +++ b/select2.js @@ -482,7 +482,7 @@ the specific language governing permissions and limitations under the Apache Lic $document.bind("mousedown touchend", function (e) { var target = $(e.target).closest("div.select2-container").get(0), attr; var targetDropdown = null; - if (target) { + if (target && $(target).data("select2") ) { $document.find("div.select2-container-active").each(function () { if (this !== target) $(this).data("select2").blur(); });