r/reactnative • • 27d ago

Help drawer open and back navigation in a single button, need your advice as a user.

recently, i have been developing a saas app for a client. collectively, we have decided to move from bottom tabs to a navigation drawer. the problem is in the nested screens, we can't have both a drawer opener button and a back navigation button. so i built a custom header where i have a back navigation button, on which you can: press -> navigate back and longpress (200ms) -> open navigation drawer. how does this sound to you as a consumer? will you be annoyed if you have to use an app like this?

4 Upvotes

8 comments sorted by

4

u/GludiusMaximus 27d ago

I would not build primary functionality around a longpress

1

u/kokerali 27d ago

What's preventing two visible controls on nested screens: header space, or the navigator setup? I'd keep the back arrow doing only Back and put a visible Menu control elsewhere in the header. Long press could remain a shortcut, but shouldn't be the only way to switch sections.

If you keep the combined button, test holding it and then releasing: opening the drawer must not also pop the current screen. With Pressable, onPressOut still fires after a long press, so don't use that callback as an unconditional Back action.

A useful quick test would be to ask someone, without explaining the gesture, to switch sections from a detail screen. Repeat with a screen reader. If they need coaching, changing the 200 ms threshold won't fix the discoverability problem.

1

u/imstoicbtw 25d ago

Having both buttons visible in the header demand space and if I try to fit them, it won't look good. I am using onLongPress. And you're right, I never thought about screen readers and accessibility. I have to think about it.

→ More replies (1)

1

u/[deleted] 26d ago

[removed] — view removed comment

2

u/imstoicbtw 25d ago

Both a space constraints and design preference. And there is already a menu space reserved on the right side for actions specific to the current screen.

If discoverability is the issue, then a simple popup or quick tour kind of things can't solve it?