fix: scrolling on swiping to open menu
This commit is contained in:
parent
b1ea855986
commit
b0590c81f2
@ -73,6 +73,7 @@ export const HeaderSidebar = ({ children }: HeaderSidebarProps) => {
|
|||||||
|
|
||||||
setMenuTranslate(null);
|
setMenuTranslate(null);
|
||||||
setNotificationsTranslate(null);
|
setNotificationsTranslate(null);
|
||||||
|
document.body.classList.remove('touch-none', 'overflow-hidden');
|
||||||
},
|
},
|
||||||
onSwipeStart: e => {
|
onSwipeStart: e => {
|
||||||
if (e.dir === 'Down' || e.dir === 'Up') return;
|
if (e.dir === 'Down' || e.dir === 'Up') return;
|
||||||
@ -97,9 +98,11 @@ export const HeaderSidebar = ({ children }: HeaderSidebarProps) => {
|
|||||||
if ((isMenuOpen && e.dir === 'Left') || (allMenusClosed && e.dir === 'Right' && xPercent <= 0.6)) {
|
if ((isMenuOpen && e.dir === 'Left') || (allMenusClosed && e.dir === 'Right' && xPercent <= 0.6)) {
|
||||||
setMenuTranslate(e.deltaX);
|
setMenuTranslate(e.deltaX);
|
||||||
e.event.preventDefault();
|
e.event.preventDefault();
|
||||||
|
document.body.classList.add('touch-none', 'overflow-hidden');
|
||||||
} else if ((isNotificationsOpen && e.dir === 'Right' || (allMenusClosed && e.dir === 'Left' && xPercent >= 0.4))) {
|
} else if ((isNotificationsOpen && e.dir === 'Right' || (allMenusClosed && e.dir === 'Left' && xPercent >= 0.4))) {
|
||||||
setNotificationsTranslate(e.deltaX);
|
setNotificationsTranslate(e.deltaX);
|
||||||
e.event.preventDefault();
|
e.event.preventDefault();
|
||||||
|
document.body.classList.add('touch-none', 'overflow-hidden');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSwiping: e => {
|
onSwiping: e => {
|
||||||
|
Loading…
Reference in New Issue
Block a user