Mobile Gestures Hook #83
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A React Hook for detecting swipe gestures on mobile devices. Used in the mobile navbar, and potentially anywhere else that needs it.
Notes from Amy:
Currently, when you open the mobile navbar menu, the only way to close it again is to click on the gray background area (or to click on one of the links). However, on really small screens (eg. the Galaxy Fold), the menu is actually wider than the screen, so you can't see the gray background at all and thus you can't close the menu (unless you click on one of the links). Also, we realized that swiping to close the menu feels more natural than just clicking. Furthermore, if we ever want to use this swiping detection behaviour in other parts of the site, then having this hook will make that pretty easy too.
Ideally, we not only want to be able to detect when the screen is being swiped, but also what direction the user is swiping in - in the case of the navbar, we'd only want to close the menu when the user is swiping to the right, and not when they're swiping up or down.