Skip to content

Commit

Permalink
fix: do not prevent uncancelable events, fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 3, 2022
1 parent af8fd75 commit 9d12786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SideEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) {

// self event, and should be canceled
if (sourceEvent && sourceEvent.should) {
event.preventDefault();
if (event.cancelable) {
event.preventDefault();
}

return;
}
Expand All @@ -135,7 +137,9 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) {
shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;

if (shouldStop) {
event.preventDefault();
if (event.cancelable) {
event.preventDefault();
}
}
}
}, []);
Expand Down

0 comments on commit 9d12786

Please sign in to comment.