feat: Add option to disable mousewheel carousel scrolling (#2263)

- Closes: #2220
This commit is contained in:
Dermot Duffy
2025-12-08 17:19:56 -08:00
committed by GitHub
parent f276b8c57d
commit 13bea49429
18 changed files with 69 additions and 7 deletions
@@ -239,6 +239,24 @@ describe('CarouselController', () => {
);
});
it('should not include wheel plugin when wheelScrolling is false', () => {
const children = createTestSlideNodes();
const root = createRoot();
const parent = createParent({ children: children });
new CarouselController(root, parent, { wheelScrolling: false });
// Verify WheelGesturesPlugin is NOT present
expect(EmblaCarousel).toBeCalledWith(
root,
expect.anything(),
expect.not.arrayContaining([
expect.objectContaining({
name: 'wheelGestures',
}),
]),
);
});
it('should recreate carousel when children are added', () => {
const children = createTestSlideNodes();
const root = createRoot();