do not leak click events. fixes #1622
This commit is contained in:
parent
e09292d800
commit
fb8bf6d51d
@ -688,7 +688,9 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.opts.element
|
this.opts.element
|
||||||
.data("select2", this)
|
.data("select2", this)
|
||||||
.attr("tabindex", "-1")
|
.attr("tabindex", "-1")
|
||||||
.before(this.container);
|
.before(this.container)
|
||||||
|
.on("click.select2", killEvent); // do not leak click events
|
||||||
|
|
||||||
this.container.data("select2", this);
|
this.container.data("select2", this);
|
||||||
|
|
||||||
this.dropdown = this.container.find(".select2-drop");
|
this.dropdown = this.container.find(".select2-drop");
|
||||||
@ -697,6 +699,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
this.dropdown.addClass(evaluate(opts.dropdownCssClass));
|
this.dropdown.addClass(evaluate(opts.dropdownCssClass));
|
||||||
this.dropdown.data("select2", this);
|
this.dropdown.data("select2", this);
|
||||||
|
this.dropdown.on("click", killEvent);
|
||||||
|
|
||||||
this.results = results = this.container.find(resultsSelector);
|
this.results = results = this.container.find(resultsSelector);
|
||||||
this.search = search = this.container.find("input.select2-input");
|
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
|
// initialize the container
|
||||||
this.initContainer();
|
this.initContainer();
|
||||||
|
|
||||||
|
this.container.on("click", killEvent);
|
||||||
|
|
||||||
installFilteredMouseMove(this.results);
|
installFilteredMouseMove(this.results);
|
||||||
this.dropdown.on("mousemove-filtered touchstart touchmove touchend", resultsSelector, this.bind(this.highlightUnderEvent));
|
this.dropdown.on("mousemove-filtered touchstart touchmove touchend", resultsSelector, this.bind(this.highlightUnderEvent));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user