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

Bugfix: Fixed typo in utils/elementIsChildOf #7649

Merged

Conversation

andreyoganesyan
Copy link
Contributor

The current implementation of elementIsChildOf function references a variable 'element', which is not defined in its scope:

function elementIsChildOf(el, parent) {
  const isChild = parent.contains(el);
  if (!isChild && parent instanceof HTMLSlotElement) {
    const children = [...element.assignedElements()];
    return children.includes(el);
  }
  return isChild;
}

I believe it should've been 'parent', the current implementation just throws an error if parent is an HTMLSlotElement.

@nolimits4web nolimits4web merged commit 575e715 into nolimits4web:master Jul 26, 2024
3 checks passed
@nolimits4web
Copy link
Owner

Thanks!

This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants