-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
I have a control button that triggers the following:
function handlePrevClick() {
if (currentPageIndex > 0) {
carousel.goToPrev();
}
}
I'm also tracking changes this way:
function handlePageChange(e: CustomEvent<number>) {
currentPageIndex = e.detail;
}
<Carousel
arrows={false}
bind:this={carousel}
dots={false}
infinite={false}
on:pageChange={handlePageChange}
swiping={false}
>
</Carousel
The issue happens when handlePrevClick
is called via a button click. It's working well in browser: I can debug the handlePrevClick
and handlePageChange
are both called; however, when I run unit tests (testing-library/svelte), even though I can see that handlePrevClick
is called, handlePageChange
isn't called.
Metadata
Metadata
Assignees
Labels
No labels