fix: scope iOS selection allow to the locked element so handles drag in any direction#161
Open
hirbod wants to merge 1 commit into
Open
fix: scope iOS selection allow to the locked element so handles drag in any direction#161hirbod wants to merge 1 commit into
hirbod wants to merge 1 commit into
Conversation
This was referenced May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #144. The current iOS selection allowance only skips
preventDefaultwhen the touchmove target is insideselection.anchorNode. On iOS Safari (tested on 26.4.2) that check fails for several common cases inside Radix Dialog / similar lock-scroll modals:anchorNode).anchorNodeeven when the user is clearly mid-gesture.The result: handles get stuck after the initial long-press and the user can't re-select.
How
Key the allowance off the locked element instead. If there's an active non-collapsed selection AND the touch target is inside
lastProps.current.lockRef.current, skippreventDefault. Touches outside the locked element still hit the normal scroll-lock path, so body scroll lock keeps working.This is a strict superset of the existing behavior for any selection that's actually inside the locked element, which is the only case that matters for the iOS bug.
Verification
yarn test).Refs radix-ui/primitives#3331.