Closed Farhan7786 closed 1 year ago
hello. pls - let's see an example when not working. thx
I am having the same issue. To reproduce on iOS, I can put a component like this:
<Text onLongPress={() => console.log("Long press")}>Test
If I hold down on this component before enabling, the event fires. If I hold down on this component after RNScreenshotPrevent.enableSecureView(), the event will not fire.
Would be great to have this issue fixed. Works well otherwise, and I have not found a solution that works on iOS other than this.
I am having the same issue. To reproduce on iOS, I can put a component like this:
<Text onLongPress={() => console.log("Long press")}>Test
If I hold down on this component before enabling, the event fires. If I hold down on this component after RNScreenshotPrevent.enableSecureView(), the event will not fire.
Would be great to have this issue fixed. Works well otherwise, and I have not found a solution that works on iOS other than this.
Just a workaround for this issue is to add a delayLongPress of 300 ms on all the touchables which are imported from react native like touchableopacity and pressable it will work. Also i dont think
Text or View not have property onPress/onLongPress.. all press event create base on PanGestures or other similar, like: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Pressability/Pressability.js#L455 which detect start, move and end screen interaction.. maybe use special components for detect pressing and error not repeat again?
I was able to get it working with the workaround of adding delayLongPress. My guess is that the view on iOS is interrupting any presses longer than about 300ms, but it does seem to be a repeatable issue.
in clear project - work fine longressing and delayed small then 300ms. I use usePreventScreenshot() and useDisableSecureView() together. need more information. thx
information not send. pls, reopen issue if problem still exist
When we enable this screenshot prevent. onLongPress touchable events are not firing.