signature_pad icon indicating copy to clipboard operation
signature_pad copied to clipboard

iphone X and 12 issue

Open umotivo-official opened this issue 3 years ago • 15 comments

Hi!

Signature Pad don't work on iphone X and iphone 12, when I try write something I have instant refresh.

@2.3.2 from cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js

thanks for help!

umotivo-official avatar Nov 15 '21 14:11 umotivo-official

Link to movie showing bug: http://umotivo.pl/1.MOV

url to platform: http://przychodnia.klitom4.stronazen.pl/

umotivo-official avatar Nov 15 '21 14:11 umotivo-official

Unfortunately I don't have an iPhone to test this on. It seems to work fine on Android.

If anyone has the ability to test this and find a fix please create a PR.

UziTech avatar Nov 15 '21 17:11 UziTech

Out of curiosity I used AWS Device Farm to try this on an iPhone 12 running iOS 14.8. It worked correctly, both with our app and also the OP's app. So we might need to get more details on how to reproduce the problem reliably? I'll be glad to contribute if we end up identifying an issue.

larrymcp avatar Nov 16 '21 07:11 larrymcp

@larrymcp @UziTech You have to be running on iOS 15.

iPhone 11 Pro running 15 on browser stack:

https://user-images.githubusercontent.com/10186520/142037332-53d9f539-1ce1-498a-94b9-e509f234d9e6.mov

iPhone 12 running 14.7 on browser stack:

https://user-images.githubusercontent.com/10186520/142037540-077f4bfd-4ae8-4ffc-a493-af03ea496b06.mov

I also confirmed it doesn't work on my personal iPhone 11 running v15, and it works on my wife's iPhone 11 running v14.

Unfortunately I do not have a fix, just wanted to help provide data.

mcrowder65 avatar Nov 16 '21 17:11 mcrowder65

it seems like the move events aren't being triggered. If this is something the browser does for privacy I don't think there is anything we can do to fix it. Unfortunately Safari has made choices to prioritize privacy over usability of it's web browser and I think this is a consequence.

UziTech avatar Nov 16 '21 18:11 UziTech

@mcrowder65 thank you so much for that bit of information, pointing the way to iOS v15. I just ran some more tests too, on BrowserStack using that same device iPhone 11 Pro with iOS v15.

I think there are some signs of hope here! I noticed that:

(1) Frequently it will let you draw several lines before the screen-clearing problem occurs, as shown in @mcrowder65 's first video. That's good news because it doesn't appear to be the result of some restriction that Safari deliberately implemented. The screen-clearing happens at random times, and during my testing it was sometimes even quite rare.

(2) I can't get the screen-clearing problem to occur in our own installation of Signature_Pad. It occurs in the demo with moderate frequency, and it occurs in @umotivo-official 's app with high frequency, but in our own app I can't get it to occur at all. So that's good news too: if it sometimes works correctly on iOS v15, then apparently the problem only occurs with particular combinations of implementation settings.

larrymcp avatar Nov 17 '21 01:11 larrymcp

The clearing is almost certainly an issue with the canvas resizing because a toolbar moves. Every time a canvas is resized safari clears it and I don't think there is any way for us to detect that. (I believe this is all browsers not just safari). @larrymcp your app must use a set width and height for the canvas (so there is no resizing) where the demo is based on the screen size.

UziTech avatar Nov 17 '21 01:11 UziTech

Ah, excellent sleuthing and yes our app uses a fixed size.

larrymcp avatar Nov 17 '21 01:11 larrymcp

If clearing on resize is the issue you can do the following:

window.addEventListener("resize", () => {
  signaturePad.fromData(signaturePad.toData());
});

UziTech avatar Nov 17 '21 02:11 UziTech

thanks a lot! I try Your solutions and back with feedback!

umotivo-official avatar Nov 17 '21 12:11 umotivo-official

Hi!

Signature Pad don't work on iphone X and iphone 12, when I try write something I have instant refresh.

@2.3.2 from cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js

thanks for help!

Hey, were you able to find a solution on this? library not working on ios safari. When you try to scribble it scrolls the entire page up/down. Desperate to find a solution!

kogekar avatar Dec 15 '21 13:12 kogekar

Hi, I weren't able to find a solution.

Waiting for the official bugfix.

Hi! Signature Pad don't work on iphone X and iphone 12, when I try write something I have instant refresh. @2.3.2 from cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js thanks for help!

Hey, were you able to find a solution on this? library not working on ios safari. When you try to scribble it scrolls the entire page up/down. Desperate to find a solution!

umotivo-official avatar Dec 17 '21 17:12 umotivo-official

Is this fixed in the latest release?

UziTech avatar Jan 21 '22 23:01 UziTech

Is this fixed in the latest release?

Doesn't seem like. Tested demo on iPhone 13 iOS 15.4.

Once the bar is triggered thru scrolling, signature disappears.

Edit: If website is added to homescreen and started as webapp, no url-bar is shown and signature pad works fine.

nolyboms avatar Apr 29 '22 01:04 nolyboms

Safari on iOS will trigger the resize event when the 'address bar' disappears/appears after scrolling, this can be considered normal behaviour because the viewport changes in height.

A solution in this case could be to keep track of the screen width and only perform a 'clear signature' action when the width is changed.

PolygonFox avatar Jun 23 '22 10:06 PolygonFox

I am facing an issue while rotating Signature pad in IOS version 16 and above.I try to find the root cause issue but didn't get any positive response is there any solution to resolve this issue kindly help me to resolve this issue ASAP.

Please find the link https://drive.google.com/file/d/1sKI2ObIYSt-dPcaQBGFMS1fvt5HVqm2m/view?usp=share_link

AjeethSG avatar Nov 01 '22 14:11 AjeethSG

@AjeethSG have you tried https://github.com/szimek/signature_pad#handling-canvas-resize

UziTech avatar Nov 01 '22 15:11 UziTech

@UziTech Hi Team, Ill tried already that canvas resize. Its worked up to iOS version 16 below. When rotating the Signature pad on iOS version 16 and above, I am experiencing problems with the rotation of the screen. It rotates a screen after enabling 'shake a undo' option. But I want to rotate a screen without enabling the option. In this case, I have tried to find the root cause of the error, but I have been unable to find it. The question that I would like to ask in this case is, can you please confirm, is this a issue? And How can this issue be resolved, and do you have any suggestions on how to do this? Kindly assist me to resolve this issue asap.

AjeethSG avatar Nov 02 '22 12:11 AjeethSG

@AjeethSG what exactly is the issue you are seeing. In your video it looks like it doesn't disappear when it rotates.

UziTech avatar Nov 02 '22 14:11 UziTech

@UziTech While trying to rotate the screen in iOS version 16, there was an error. The rotation doesn't work until we shake the phone and then it rotates smoothly. But in older versions of iOS below 16, it used to work fine, and I'm only experiencing this issue since the recent update. Kindly assist me to resolve this issue ASAP.

AjeethSG avatar Nov 02 '22 14:11 AjeethSG

That seems like an iOS issue not a signature_pad issue. We don't do anything to prevent the screen from rotating. You would be better off asking somewhere else.

UziTech avatar Nov 02 '22 16:11 UziTech

I'm going to close this issue as there doesn't seem to be a clear issue. If the original issue still happens please create a new issue with more details.

UziTech avatar Nov 02 '22 16:11 UziTech