Skip to content

refresh() does not add CSS classes #123

Description

@sqwk

I am checking if new elements have been been added to the DOM to call refresh():

    const solutionList = document.getElementById('solution-list');
    if (solutionList != null) {
        const observer = new MutationObserver((mutations) => {
            mutations.forEach((mutation) => {
                mutation.addedNodes.forEach((addedNode) => {
                    if (addedNode.nodeName != "#text") {
                        BackgroundCheck.refresh((addedNode as HTMLElement).querySelector('.solution-title'));
                    }
                });
            });
        });
        observer.observe(solutionList, { childList: true, subtree: true });
    }

Neither BackgroundCheck.refresh() or BackgroundCheck.refresh(target) add the needed classes to the targets. Instead I get Uncaught [object HTMLHeadingElement] is not a target in the console.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions