Prevent excessive touchmove variable reassignments

This commit is contained in:
Josh Johnson 2016-08-07 22:16:05 +01:00
parent e5eb34ea97
commit f785360b50
2 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -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') {