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

ShadowRoot.contains doesn't return the right value when passing itself #976

Closed
pmdartus opened this issue Jan 17, 2019 · 0 comments · Fixed by #1000
Closed

ShadowRoot.contains doesn't return the right value when passing itself #976

pmdartus opened this issue Jan 17, 2019 · 0 comments · Fixed by #1000
Labels

Comments

@pmdartus
Copy link
Member

Description

Node.contains should return true if the node passed as parameter is a descendant (ie. itself or a child node). However, when invoking contains on the ShadowRoot and passing itself it returns false instead of true.

const elm = createElement('x-test', { is: Test });
console.log(elm.shadowRoot.contains(elm.shadowRoot));
// Returns: false
// Expected: true

Version

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

Successfully merging a pull request may close this issue.

1 participant