diff --git a/src/VirtualScroll.svelte b/src/VirtualScroll.svelte index 5e44af7..4278622 100644 --- a/src/VirtualScroll.svelte +++ b/src/VirtualScroll.svelte @@ -1,7 +1,7 @@ <script> import Virtual from "./virtual" import Item from "./Item.svelte" - import {createEventDispatcher, onDestroy, onMount} from "svelte" + import {createEventDispatcher, onDestroy, onMount, afterUpdate} from "svelte" /** * Unique key for getting data from `data` @@ -189,6 +189,8 @@ } }) + afterUpdate(() => dispatch("updated")) + onDestroy(() => { virtual.destroy() if (pageMode) {