RepairShopr / react-native-signature-capture

A simple modular component for react native (iOS) to capture a signature as an image
MIT License
962 stars 514 forks source link

Can't make second stroke on iOS #117

Open sslotsky opened 6 years ago

sslotsky commented 6 years ago

Using version 0.4.9, xcode version 9.2 react-native version 0.51.0

This library works as I'd expect on Android. But on iOS, if I attempt to make a second stroke, it clears the first. This requires users to complete a signature in a single stroke.

my-hero

sslotsky commented 6 years ago

I've discovered why this happens... sort of. We are calling saveImage on drag instead of waiting for a save button to be clicked to do it, as is shown in the README. So subsequent drags call saveImage which behaves differently on iOS than it does on Android. I can continue drawing on my Android device but saveImage seems to clear the signature on iOS.

The way our component is laid out also makes it difficult for me to switch to calling saveImage on save, rather than drag. Any chance of making the behavior consistent across platforms?

kosiakMD commented 6 years ago

@sslotsky, I think it's a bad idea to save on drag - where do you save? It can cause multiple overheads redundant saves. And decrease performance or smth like that. Do you use some debounce? As a variant, you can save by additional script with delay (setTimeout / Interval). Also, save image should not clear the canvas. Hove mush rendered Signature-Captures do you have at one time?

hanaechahid commented 3 years ago

Hello @sslotsky , did you find any solution for this IOS issue?

sslotsky commented 3 years ago

@hanaechahid I never did!