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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant