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
12 changes: 11 additions & 1 deletion src/SideEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,17 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) {
let canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);

if (!canBeScrolledInMainDirection) {
return true;
// If the main direction can't be scrolled, check the other axis.
// This prevents blocking vertical scroll when the initial touch delta
// is slightly more horizontal than vertical (diagonal swipe).
const otherAxis: Axis = moveDirection === 'v' ? 'h' : 'v';

if (locationCouldBeScrolled(otherAxis, target)) {
currentAxis = otherAxis;
canBeScrolledInMainDirection = true;
} else {
return true;
}
}

if (canBeScrolledInMainDirection) {
Expand Down