mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-10 09:52:18 +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
|
* @private
|
||||||
*/
|
*/
|
||||||
_onTouchMove(e) {
|
_onTouchMove(e) {
|
||||||
this.wasTap = false;
|
if(this.wasTap === true) {
|
||||||
|
this.wasTap = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Touch end event
|
* Touch end event
|
||||||
* @param {Object} e Event
|
* @param {Object} e Event
|
||||||
|
@ -988,7 +989,7 @@ export class Choices {
|
||||||
*/
|
*/
|
||||||
_onTouchEnd(e) {
|
_onTouchEnd(e) {
|
||||||
const target = e.target || e.touches[0].target;
|
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 there was no scrolling, open/focus element
|
||||||
if((target === this.containerOuter || target === this.containerInner) && this.passedElement.type !== 'select-one') {
|
if((target === this.containerOuter || target === this.containerInner) && this.passedElement.type !== 'select-one') {
|
||||||
|
|
Loading…
Reference in a new issue