1
0
mirror of synced 2025-02-04 06:09:23 +03:00

do not leak click events. fixes #1622

This commit is contained in:
Igor Vaynberg 2013-09-03 21:16:16 -07:00
parent e09292d800
commit fb8bf6d51d

View File

@ -688,15 +688,18 @@ the specific language governing permissions and limitations under the Apache Lic
this.opts.element
.data("select2", this)
.attr("tabindex", "-1")
.before(this.container);
.before(this.container)
.on("click.select2", killEvent); // do not leak click events
this.container.data("select2", this);
this.dropdown = this.container.find(".select2-drop");
syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
this.dropdown.addClass(evaluate(opts.dropdownCssClass));
this.dropdown.data("select2", this);
this.dropdown.on("click", killEvent);
this.results = results = this.container.find(resultsSelector);
this.search = search = this.container.find("input.select2-input");
@ -708,6 +711,8 @@ the specific language governing permissions and limitations under the Apache Lic
// initialize the container
this.initContainer();
this.container.on("click", killEvent);
installFilteredMouseMove(this.results);
this.dropdown.on("mousemove-filtered touchstart touchmove touchend", resultsSelector, this.bind(this.highlightUnderEvent));