Skip to content

Commit 06c82f2

Browse files
committed
do not propagate change event from the search field out of the component. fixes select2#1178
1 parent 733f19e commit 06c82f2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

select2.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,10 @@ the specific language governing permissions and limitations under the Apache Lic
661661
installDebouncedScroll(80, this.results);
662662
this.dropdown.delegate(resultsSelector, "scroll-debounced", this.bind(this.loadMoreIfNeeded));
663663

664+
// do not propagate change event from the search field out of the component
665+
$(this.container).delegate(".select2-input", "change", function(e) {e.stopPropagation();});
666+
$(this.dropdown).delegate(".select2-input", "change", function(e) {e.stopPropagation();});
667+
664668
// if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
665669
if ($.fn.mousewheel) {
666670
results.mousewheel(function (e, delta, deltaX, deltaY) {

0 commit comments

Comments
 (0)