mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-19 05:56:33 +02:00
Prevent excessive touchmove variable reassignments
This commit is contained in:
parent
e5eb34ea97
commit
f785360b50
2
assets/scripts/dist/choices.min.js
vendored
2
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -976,10 +976,11 @@ export class Choices {
|
|||
* @private
|
||||
*/
|
||||
_onTouchMove(e) {
|
||||
this.wasTap = false;
|
||||
if(this.wasTap === true) {
|
||||
this.wasTap = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Touch end event
|
||||
* @param {Object} e Event
|
||||
|
@ -988,7 +989,7 @@ export class Choices {
|
|||
*/
|
||||
_onTouchEnd(e) {
|
||||
const target = e.target || e.touches[0].target;
|
||||
if(this.wasTap && this.containerOuter.contains(target)) {
|
||||
if(this.wasTap === true && this.containerOuter.contains(target)) {
|
||||
|
||||
// If there was no scrolling, open/focus element
|
||||
if((target === this.containerOuter || target === this.containerInner) && this.passedElement.type !== 'select-one') {
|
||||
|
|
Loading…
Reference in a new issue