Mobile Gestures Hook #83

Open
opened 2 years ago by a258wang · 1 comments
Owner

A React Hook for detecting swipe gestures on mobile devices. Used in the mobile navbar, and potentially anywhere else that needs it.

A React Hook for detecting swipe gestures on mobile devices. Used in the mobile navbar, and potentially anywhere else that needs it.
a258wang added the
Backlog
label 2 years ago
a258wang self-assigned this 2 years ago
a3thakra added this to the Pre launch milestone 2 years ago
a258wang removed their assignment 2 years ago
a3thakra modified the milestone from Pre launch to Post launch 2 years ago
a3thakra removed the
Backlog
label 2 years ago
l42luo self-assigned this 2 years ago
l42luo removed their assignment 2 years ago
w25tran self-assigned this 2 years ago
a3thakra added the
Priority - Low
label 2 years ago

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.

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.
w25tran was unassigned by a258wang 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: www/www-new#83
Loading…
There is no content yet.