Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Checking textContent means that components that have dynamic content or content in shadow DOM fail #151

Open
KeithHenry opened this issue Apr 30, 2020 · 0 comments

Comments

@KeithHenry
Copy link

The show action checks that content is populated before displaying it, and it does this by checking for textContent:

if (dom(this).textContent.trim() === '') {
// Check if effective children are also empty
var allChildrenEmpty = true;
var effectiveChildren = dom(this).getEffectiveChildNodes();
for (var i = 0; i < effectiveChildren.length; i++) {
if (effectiveChildren[i].textContent.trim() !== '') {
allChildrenEmpty = false;
break;
}
}
if (allChildrenEmpty) {
return;
}
}

The problem is if you have something like:

<paper-tooltip>
    <my-component></my-component>
</paper-tooltip>

Now <my-component> might have a textContent, but if it doesn't the tooltip never shows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant