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

Component was still attached to body instead of element from attachTo #1619

Closed
JeromeDeLeon opened this issue Jul 22, 2020 · 2 comments
Closed

Comments

@JeromeDeLeon
Copy link

Subject of the issue

I don't know if what I'm doing is right but I am expecting the component to be attached in a div with an id of app but it's working as expected.

I provided a codesandbox to replicate my issue.

Steps to reproduce

Run the test.

Expected behaviour

The two logs of innerHTML of the body should have a parent of div with an id of app.

Actual behaviour

It attached the component on the directly in the body.

Possible Solution

What are the alternative solutions? Please describe what else you have considered?

@JeromeDeLeon JeromeDeLeon changed the title attachTo doesn't allow attaching to body Component was still attached to body instead of element from attachTo Jul 22, 2020
@JeromeDeLeon
Copy link
Author

I don't know why the wrapper div document was getting removed just before mounting the component.

I found that createElement works just fine but if do that outside mount or before $mount, it will not work.

Now, the tests made on #1492 were passing because it didn't check whether it was really attached on the div wrapper. It was just checking if the root is null but I don't think it's the right behavior. Correct me if I'm wrong.

@JeromeDeLeon
Copy link
Author

Not conforming to issue guidelines

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

1 participant