Gestures on Web
Hirbod
I am missing gestures on web. I've read the documentation has a topic about it:
"Swipe gestures are not available on drawer and stack navigators when using on the web."
I think thats a bummer, specially when you target mobile devices on web. I really do miss the feature that I can't drag a modal down to close it on web. It should be able to activate this via a prop.
satya164
Browser UIs interfere with gestures on Web, e.g. Safari has it's built-in back gestures. It's not realistic to be able to provide usable gestures on Web.
Users are also not used to such gestures on Web and don't expect apps to have gestures.
Hirbod
satya164: while it is mainly true, there are usecases, where you wanna build a mobile web app (with app feeling) and those expectations are differently. And since iOS 13 you are able to block the built-in back gestures (which I did for my project)
Hirbod
satya164: I did some patch-package attemps in combination with iOS 13+ capabilities to "preventDefault" a touchstart.
Like so:
document.addEventListener(
"touchstart",
(e: any) => {
// is not near edge of view, exit
if (e.pageX > 15 && e.pageX < window.innerWidth - 15) return;
// prevent swipe to navigate gesture
e.preventDefault();
},
{ passive: false }
);
After disabling the native built-in back gestures and patching "CardStack.js" + GestureHandler.tsx + useKeyboardManager.tsx for web, I was able to get resonable gestures out of the box. There are still some bugs, like nested gestured + the parent gestures trigger at the same time. I don't see any realistic scenario why this lib would force us not to have gestures on the web so far, as we CAN in fact block the native ones when we aim to build a native-app behavior with react-native-web.