Skip to content

removeOutsideClicEvent has no effect because of slice instead of splice #1

@danielSt-dev

Description

@danielSt-dev

Hi,

in outsideclickhandler.js there is a cleanup routine which is called after dispose of the component.
This has no effect because of using slice.

function removeOutsideClickEvent(index) {
elementRefs.slice(index, 1);
if (elementRefs.length === 0) {
window.removeEventListener("click", outsideClickEvent);
hasOutsideClickEvent = false;
}
}

--> slice returns a copy of the changed array. Use splice instead to clean up old references

Thanks

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