Skip to content

Commit

Permalink
Validation component exist in onDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Mar 13, 2020
1 parent ef5f6e3 commit 1311633
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
};
onDestroy(() => {
const element = elementScroll ? elementScroll : component.parentNode;
if (component || elementScroll) {
const element = elementScroll ? elementScroll : component.parentNode;
element.removeEventListener("scroll", null);
element.removeEventListener("resize", null);
element.removeEventListener("scroll", null);
element.removeEventListener("resize", null);
}
});
</script>

Expand Down

0 comments on commit 1311633

Please sign in to comment.