Add ability to pan on the drawer view when it is 'open'. #270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
I want to swipe on the side menu (in this case DrawerContent) to close the drawer.
So I play around with the original source code and configure as below:
Now I can pan on the DrawerContent to close the Drawer.
The problem is, if there is any clickable views in DrawerContent, it will be ignored when clicking on it.
So I added this props to prioritize the subviews gesture responder.
Now I can click on the subviews in DrawerContent.
But the problem now is, because Drawer does not capture gestures, clicking on subviews in Main is captured. I don't want those.
What I want is when clicking on Main, Drawer will be closed instead of propagating the gesture to the subviews.
This problem does not happen when using
captureGestures={'open'}
So
I think if there is some code for Drawer to capture gestures when clicking/panning on Main to close the Drawer. And not capturing gestures when clicking on DrawerContent so that subviews (ex. side menu items) be able to click.
Actually the original code base already did that with the configuration below
However
The original code limits gestures when panning outside the mask. That's why I can not pan on the DrawerContent.
Finally
I edit some lines of code to allow panning in the DrawerContent when setting
acceptPanOnDrawer={true}
(default=true).