Skip to content

ARnft.dispose() removes #app even if it did not create it #263

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

Open
andreyrd opened this issue Mar 3, 2022 · 2 comments
Open

ARnft.dispose() removes #app even if it did not create it #263

andreyrd opened this issue Mar 3, 2022 · 2 comments
Labels
bug Something isn't working Feature request

Comments

@andreyrd
Copy link

andreyrd commented Mar 3, 2022

Calling ARnft.dispose() will remove the #app element even if it was not created by ARnft:

CameraViewRenderer.ts:230

                let currentAR = document.getElementById("app");
                if (currentAR !== null && currentAR !== undefined) {
                    currentAR.remove();
                }

This is a problem for a Vue app, since it ends up destroying the entire app.

What if you add a special data-arnft attribute to app when creating it in Container.ts, and if that does not exist, you don't remove the element.

I can open a PR if that makes sense.

@kalwalt
Copy link
Member

kalwalt commented Mar 3, 2022

Good catch @andreyrd ! Yes please open a PR, start from the dev branch creating a new one for example feature -data-arnft or name it as you prefer.
Also the terminate worker function need to be improved, actually i think can't terminate a single worker.

@andreyrd
Copy link
Author

andreyrd commented Mar 3, 2022

I'll try to get it soon.
I think this method needs to be aware of the global config, and use that to determine if the container was created. Because the user may have also specified an id other than app for the container.

@kalwalt kalwalt added bug Something isn't working Feature request labels Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Feature request
Projects
None yet
Development

No branches or pull requests

2 participants