Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/core/src/lib/slidy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ export function slidy(node: HTMLElement, opts: Partial<Options>): SlidyInstance
const WINDOW_EVENTS: EventMap[] = [
['touchmove', onMove as EventListener, { passive: false }],
['mousemove', onMove as EventListener],
['touchend', onUp as EventListener],
['mouseup', onUp as EventListener],
['touchend', onUp as EventListener, { passive: true }],
['mouseup', onUp as EventListener, { passive: true }],
[
'scroll',
() => {
to(INDEX);
GRAVITY = 2;
},
{ passive: true },
],
];
const WINDOW_NATIVE_EVENTS: EventMap[] = [
Expand All @@ -46,7 +47,7 @@ export function slidy(node: HTMLElement, opts: Partial<Options>): SlidyInstance
['touchstart', onDown as EventListener, { passive: false }],
['mousedown', onDown as EventListener],
['keydown', onKeys as EventListener],
['contextmenu', () => to(INDEX)],
['contextmenu', () => to(INDEX), { passive: true }],
['dragstart', (e) => e.preventDefault()],
];

Expand Down