From 6690cc449cfbe2bcb3d5937092a8ec1d19fb52dc Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Wed, 12 Sep 2012 16:20:34 -0700 Subject: [PATCH] fix clearing when using jquery 1.6. fixes #386 --- select2.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index caa8660f..ceb09281 100644 --- a/select2.js +++ b/select2.js @@ -230,6 +230,10 @@ event.preventDefault(); event.stopPropagation(); } + function killEventImmediately(event) { + event.preventDefault(); + event.stopImmediatePropagation(); + } function measureTextWidth(e) { if (!sizer){ @@ -1578,7 +1582,7 @@ selection.delegate("abbr", "mousedown", this.bind(function (e) { if (!this.enabled) return; this.clear(); - killEvent(e); + killEventImmediately(e); this.close(); this.triggerChange(); this.selection.focus();