nativescript-community / ui-drawer

NativeScript plugin that allows you to easily add a side drawer (side menu) to your projects.
https://nativescript-community.github.io/ui-drawer/
Apache License 2.0
24 stars 12 forks source link

Only enable backdrop tap event as needed #20

Closed coltonwood closed 1 year ago

coltonwood commented 1 year ago

Noticed a couple missing documentation items that I fixed (I'm open to better wording on those).

But the main point of this PR is:

The reason for this is if you have enableGlobalTapAnimations set to true in your NativeScript project, it animates anything with a tap event. This can cause unexpected weirdness with the backdrop. For example, I want to scale down and change the opacity on touch. The scaling especially doesn't work with the backdrop:

2023-01-24 08 54 55.

farfromrefug commented 1 year ago

@coltonwood thanks for this! Just about the readme like the changes but in fact the readme.MD is auto generated from this file https://github.com/nativescript-community/ui-drawer/blob/master/packages/ui-drawer/blueprint.md. do you think you can apply the changes there ? Thanks

coltonwood commented 1 year ago

@farfromrefug I know this was just merged, but I just had another thought...

I think my change makes sense and should still be added to the plugin. But I also think that we should add the ignoreTouchAnimation property to the Drawer component itself. This way, even if you enable a global touch animation, it won't affect the backdrop being touched.

My fix only fixes this if you disable backdrop touches altogether. (works for my use case, but not all use cases)

Thoughts?

farfromrefug commented 1 year ago

@coltonwood indeed could be added. Wonder if we already can do that from N. Not sure as I never use those touch animation. Maybe out can ask on discord if there already a prop to disable it ?