feat: Add option to disable mousewheel carousel scrolling (#2263)
- Closes: #2220
This commit is contained in:
@@ -113,6 +113,7 @@ describe('config defaults', () => {
|
||||
style: 'ribbon',
|
||||
window_seconds: 3600,
|
||||
},
|
||||
wheel: true,
|
||||
},
|
||||
draggable: true,
|
||||
lazy_load: true,
|
||||
@@ -180,6 +181,7 @@ describe('config defaults', () => {
|
||||
style: 'ribbon',
|
||||
window_seconds: 3600,
|
||||
},
|
||||
wheel: true,
|
||||
},
|
||||
draggable: true,
|
||||
lazy_load: true,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user