From 06c82f2d0b737d036e6aa9247052240f05933a1f Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 11 Apr 2013 20:22:30 -0700 Subject: [PATCH] do not propagate change event from the search field out of the component. fixes #1178 --- select2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/select2.js b/select2.js index 779569cf..7b08bf9e 100644 --- a/select2.js +++ b/select2.js @@ -661,6 +661,10 @@ the specific language governing permissions and limitations under the Apache Lic installDebouncedScroll(80, this.results); this.dropdown.delegate(resultsSelector, "scroll-debounced", this.bind(this.loadMoreIfNeeded)); + // do not propagate change event from the search field out of the component + $(this.container).delegate(".select2-input", "change", function(e) {e.stopPropagation();}); + $(this.dropdown).delegate(".select2-input", "change", function(e) {e.stopPropagation();}); + // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel if ($.fn.mousewheel) { results.mousewheel(function (e, delta, deltaX, deltaY) {