Node.contains API doesn't work like it is described in MDN. Latter states that
The Node.contains() method returns a Boolean value indicating whether a node is a descendant of a given node, i.e. the node itself,
See this playground app:
https://developer.salesforce.com/docs/component-library/tools/playground/OhXG7B2Gh/3/edit
true is shown on the page
false is shown
Fails in chrome and firefox. Issue promises to be cross-browser
Sorry we could wait until Heroku connect make the syncronization.
Workaround:
const contains = Node.prototype.contains;
Node.prototype.contains = function (value) {
if (value === this) {
return true;
}
else {
return contains.apply(this, arguments);
}
}
I was afraid it won't help given the amount of encapsulation and protection, but it did.
I see a PR with a fix already. Very impressive!
@bmblb thanks for reporting the issue.
Most helpful comment
I see a PR with a fix already. Very impressive!