Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
This repository was 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

@KeithHenry

Description

@KeithHenry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions