Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas clears itself on iOS 15 due to Safari URL bar window resizes #65

Open
danjamesmedia opened this issue Oct 25, 2021 · 2 comments · May be fixed by #66
Open

Canvas clears itself on iOS 15 due to Safari URL bar window resizes #65

danjamesmedia opened this issue Oct 25, 2021 · 2 comments · May be fixed by #66
Labels
kind: bug problem: stale Issue author has not responded solution: workaround available A workaround is available for this issue

Comments

@danjamesmedia
Copy link

Whenever a signature canvas is drawn on iOS 15, the canvas occasionally wipes itself. See attached video, from your official demo.

RPReplay_Final1635161637.mov
@michchan
Copy link

@danjamesmedia
Found the root cause of the issue, please check the related PR:
#66

For quick workaround:
Just pass clearOnResize={false} in props (by default it is true)

@agilgur5 agilgur5 changed the title Canvas clears itself on iOS15 Canvas clears itself on iOS 15 due to Safari window resizes Feb 6, 2022
@agilgur5
Copy link
Owner

agilgur5 commented Feb 6, 2022

Ack, this issue seems very similar to Chrome for Android and iOS Safari resizing the window height due to the URL bar fading in/out. That looks like a URL bar in your video too, but just at the bottom in iOS 15(?).

Have had the pain of dealing with the URL bar in various front-end projects, but usually it only affected my responsive CSS (e.g. vh units, height media queries, etc), didn't realize that impacted react-signature-canvas's resize detection too, big oof.

Will have to think of an optimal strategy to deal with that and remember what I used in other projects to workaround it.

For quick workaround:
Just pass clearOnResize={false} in props (by default it is true)

That should indeed work as a quick workaround, but for all readers, please be aware that that is an advanced usage prop and has some drawbacks/side-effects when used without any other changes, as described in #43 .

@agilgur5 agilgur5 changed the title Canvas clears itself on iOS 15 due to Safari window resizes Canvas clears itself on iOS 15 due to Safari URL bar window resizes Feb 6, 2022
@agilgur5 agilgur5 added kind: bug solution: workaround available A workaround is available for this issue labels Feb 6, 2022
@agilgur5 agilgur5 added the problem: stale Issue author has not responded label Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug problem: stale Issue author has not responded solution: workaround available A workaround is available for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants