diff --git a/src/SideEffect.tsx b/src/SideEffect.tsx index 1c21a34..574b287 100644 --- a/src/SideEffect.tsx +++ b/src/SideEffect.tsx @@ -73,6 +73,15 @@ export function RemoveScrollSideCar(props: IRemoveScrollEffectProps) { return false; } + // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target + const selection = window.getSelection(); + const anchorNode = selection && selection.anchorNode; + const isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false; + + if (isTouchingSelection) { + return false; + } + let canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); if (!canBeScrolledInMainDirection) {