root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 390 forks source link

undocumented new default behaviour `acceptPanOnDrawer` #323

Open beeglebug opened 7 years ago

beeglebug commented 7 years ago

a recently accepted merge request (#270) added an undocumented breaking change which either needs reverting, or documenting and highlighting on the front page

the new acceptPanOnDrawer prop defaults to true, and allows a swipe inside the drawer content to close the drawer, previous default behaviour did not allow this

this prop is not mentioned anywhere in the readme

JaxGit commented 6 years ago

It will invalidate an existing prop 'panCloseMask' which is a breaking change of the expected behaviour.

Take our case for example, we have a complex DrawerContent which has its own horizontal swipe gesture. To prevent gesture conflicts, we need to keep such as panCloseMask = {0.04} only at the edge instead of 'accept pan on the whole DrawerContent'.

To maintain backward compatibility, it would be better to set defaultProps acceptPanOnDrawer: false, and documented at least.