Skip to content

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
@nolimits4web
Copy link
Owner

Thanks!

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