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

Calling start() twice creates 2 <div> #7

Open
boonkey opened this issue Apr 17, 2019 · 1 comment
Open

Calling start() twice creates 2 <div> #7

boonkey opened this issue Apr 17, 2019 · 1 comment

Comments

@boonkey
Copy link

boonkey commented Apr 17, 2019

I'm using pleaseRotate with VueJS on one of my apps.
I call pleaseRotate.start() when I'm mounting [mount()] my app.
calling pleaseRotate.stop() doesn't kill existing pleaseRotate items, so if I'm going
[app] -> [back] -> [app]
pleaseRotate.start() is called twice, while pleaseRotate.stop() is called once [on beforeDestroy()]
and pleaseRotate is activated on both portrait and landscape mode [while the flag forcePortrait is at it's default setting of true].

My workaround is to put createElements() inside the if statement:
if (!document.getElementById('pleaserotate-backdrop'))
[which checks if there is already pleaseRotate div elements existing]

please contact me with any questions regarding this issue and reproducing it.

@Friends4U
Copy link

Please share your code...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants