Fix scrolling in mobile view sidebar not working

This commit is contained in:
Hadi Nategh 2023-02-20 15:16:31 +01:00
parent 5cf63cc45e
commit 188334d647
2 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ export class tapAndSwipe {
static readonly _default : TapAndSwipeOptionsType = { static readonly _default : TapAndSwipeOptionsType = {
threshold : 10, threshold : 10,
tapHoldThreshold : 3000, tapHoldThreshold : 3000,
allowScrolling : null, allowScrolling : 'both',
swipe : function(){}, swipe : function(){},
tap : function(){}, tap : function(){},
tapAndHold: function(){} tapAndHold: function(){}
@ -125,9 +125,9 @@ export class tapAndSwipe {
this._isTapAndHold = false; this._isTapAndHold = false;
this._fingercount = event.touches.length; this._fingercount = event.touches.length;
if(event.path) if(event.composedPath())
{ {
const scrolledItem = event.path.filter(_item => { const scrolledItem = event.composedPath().filter(_item => {
return _item instanceof HTMLElement && this.element.contains(_item) && (_item.scrollTop != 0 || _item.scrollLeft !=0); return _item instanceof HTMLElement && this.element.contains(_item) && (_item.scrollTop != 0 || _item.scrollLeft !=0);
}); });
if (scrolledItem.length>0) if (scrolledItem.length>0)
@ -140,8 +140,6 @@ export class tapAndSwipe {
} }
} }
this._tapHoldTimeout = window.setTimeout(_=>{ this._tapHoldTimeout = window.setTimeout(_=>{
this._isTapAndHold = true; this._isTapAndHold = true;
//check scrolling //check scrolling

View File

@ -81,14 +81,16 @@ import {tapAndSwipe} from "../../api/js/tapandswipe";
$baseDiv.css('overflow-y','auto'); $baseDiv.css('overflow-y','auto');
break; break;
case "left": case "left":
if (distance >= 10) if (distance >= 200)
{ {
framework.toggleMenu(); framework.toggleMenu();
} }
break; break;
case "right": case "right":
framework.toggleMenu(); if (distance >= 200)
{
framework.toggleMenu();
}
} }
}, },
allScrolling: 'vertical' allScrolling: 'vertical'