[2.5] Fix scroll on ios

Closes #10145
This commit is contained in:
Mike Jolley 2016-01-25 11:31:22 +00:00
parent 3cfd4d7889
commit 793d86c9c3
2 changed files with 34 additions and 15 deletions

View File

@ -2399,22 +2399,41 @@ the specific language governing permissions and limitations under the Apache Lic
}
}));
selection.on("mousedown touchstart", this.bind(function (e) {
// Prevent IE from generating a click event on the body
reinsertElement(selection);
if(this.supportsTouchEvents) {
selection.on("mousedown touchstart", this.bind(function (e) {
// Prevent IE from generating a click event on the body
reinsertElement(selection);
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
if (this.opened()) {
this.close();
} else if (this.isInterfaceEnabled()) {
this.open();
}
if (this.opened()) {
this.close();
} else if (this.isInterfaceEnabled()) {
this.open();
}
killEvent(e);
}));
killEvent(e);
}));
} else {
selection.on("mousedown", this.bind(function (e) {
// Prevent IE from generating a click event on the body
reinsertElement(selection);
if (!this.container.hasClass("select2-container-active")) {
this.opts.element.trigger($.Event("select2-focus"));
}
if (this.opened()) {
this.close();
} else if (this.isInterfaceEnabled()) {
this.open();
}
killEvent(e);
}));
}
dropdown.on("mousedown touchstart", this.bind(function() {
if (this.opts.shouldFocusInput(this)) {

File diff suppressed because one or more lines are too long