Skip to content

Commit c186dc8

Browse files
committed
better handling for ipads. fixes select2#1949
1 parent abe7777 commit c186dc8

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+

select2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,15 +2039,15 @@ the specific language governing permissions and limitations under the Apache Lic
20392039
}
20402040
}));
20412041

2042-
selection.on("mousedown", "abbr", this.bind(function (e) {
2042+
selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
20432043
if (!this.isInterfaceEnabled()) return;
20442044
this.clear();
20452045
killEventImmediately(e);
20462046
this.close();
20472047
this.selection.focus();
20482048
}));
20492049

2050-
selection.on("mousedown", this.bind(function (e) {
2050+
selection.on("mousedown touchstart", this.bind(function (e) {
20512051

20522052
if (!this.container.hasClass("select2-container-active")) {
20532053
this.opts.element.trigger($.Event("select2-focus"));
@@ -2062,7 +2062,7 @@ the specific language governing permissions and limitations under the Apache Lic
20622062
killEvent(e);
20632063
}));
20642064

2065-
dropdown.on("mousedown", this.bind(function() { this.search.focus(); }));
2065+
dropdown.on("mousedown touchstart", this.bind(function() { this.search.focus(); }));
20662066

20672067
selection.on("focus", this.bind(function(e) {
20682068
killEvent(e);

0 commit comments

Comments
 (0)