-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drawerLockMode to DrawerView #793
Add drawerLockMode to DrawerView #793
Conversation
This PR will simplify a LOT our navigation. Thanks! :D |
Did you test that |
@ferrannp AFAIK lock-open is implemented both in Android as well as in the @martnu PR looks nice, thank you for your effort! |
@DanielMSchmidt right mmm, it would be nice thought to provide a prop as initial state of the drawer (closed or open) and then I can use it together with |
Probably better to just use a plain view on tablets. You don't need any of drawer's behaviour. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MUCH NEEDED!
@DanielMSchmidt I just updated the branch, but after CI runs I'm just waiting for a merge. |
I think it makes more sense in |
@satya164 It is useful since it allows us to only open/close the drawer programmatically and not via touch gestures since that currently conflicts with the default swipe-back behavior in a stack. I do agree that it would be nice to have it configured for each screen but I'd have to look into the code a bit more. |
How can you change this programmatically? |
@satya164 We can't change the behavior for the drawer, but I can open the Drawer programmatically via |
I see. Anyway, we should add it to |
CI is failing. You probably need to fix the flow types. |
src/views/Drawer/DrawerView.js
Outdated
const screenNavigation = addNavigationHelpers({ | ||
state: this._screenNavigationProp.state, | ||
dispatch: this._screenNavigationProp.dispatch, | ||
}); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
How to update the lock-mode dynamically? Currently setting these options only work when you do it in the DrawerNavigator options and cannot be updated. When I try to use static navigationOptions for the drawer nothing happens. I declare it on the contentComponent. Even using a global for the value for lockMode will not cause it to update when needed. |
Yes this is much needed feature. Will solve a lot of problems. |
@mmerickel Are you able to fix it? |
If you fork the library and patched it with the PR code, it works but |
Hello!! Is anyone there? This PR is critically important, I will clone this repo and work with you for this. |
Exactly, do it :) |
seems like #1377 is a better PR than this one since it allows to specify this within navigationOptions |
Hmmm 🤔 So, what's happening? Why a highly-requested 6 months-ago PR is not merged? Is there any reason? I mean, it's not even a feature. We're just passing down a prop to another lib which is doing the work behind. No big deal, no? |
can we get this or #1377 merge in? This solves some real app use cases |
@sibelius there is some issues someone need to fix |
There are conflicts in |
any update? |
@spencercarli I read on a blog post that you'll work here on react-navigation to take a look on We are building an app that this is primordial. There is any timeline or another PR, issue etc that people are working for this feature? Definitely we can help in any means. |
@guilhermedecampo going to try to get this merged asap. I'm not super familiar with drawers so I'm going to have someone else look it over. Looks good to me though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks/feels great
Not sure what CI is complaining about, I forever get a spinner on the message, but the code looks great to me @spencercarli
@spencercarli please note this PR does not allow to specify drawer lock mode in navigation options and several people already expressed they need that. There is another pr that I linked a couple of posts higher which should be able to do that, it might be good to take a look at it. |
@spencercarli - I agree with @vonovak After reviewing both PRs, I find #1377 better. We might need to make drawer lock mode optional in the type and implementation but that would be a small patch, I'm sure everyone is up for. |
Agree with @vonovak. +1 |
Just merged #1377 in! Thanks for everyone's work and input on this. Will be in the next release 😄 |
Hold coming soon !!! @spencercarli |
Wait it's being fixed!? I actually lost hope, only checking on this status once per month! Thanks guys! |
|
This allows us to disable the gesture to open the drawer. Related to #390.