Conversation
This branch has not been deployed
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.
Problem
When a view is drawn over a ScrollView inside the sheet (for example an absolutely positioned header or grabber, so the list scrolls underneath it), dragging that view could not move the sheet while the list was scrolled away from its top. At the largest detent the sheet treated the touch as a list touch and refused to collapse, and the list never received the touch either, so nothing moved.
Root cause
Both platforms chose "the scrollable under the finger" by geometry alone: any vertically scrollable view whose bounds contained the touch, even when another view was drawn over it.
Fix
sheetContainer.hitTest), which honorspointerEvents,zIndex, and hidden or transparent views, then collect that view's scrollable ancestors. Content interaction is briefly re-enabled during the hit test, so grabbing the sheet mid-settle still resolves the content.TouchTargetHelperrules. The topmost child that can take the touch wins, so a non-scrollable view shields what is underneath it. It respectspointerEvents, including onReactScrollViewandReactHorizontalScrollView, which don't implementReactPointerEventsView. Disabled views pass touches through, and child transforms and parent scroll offsets are taken into account.Example
New "Draggable grabber" demo: a modal sheet with a full-height ScrollView and a transparent grabber strip on top of it.
Testing
Tested manually on the iOS simulator and an Android emulator:
pointerEvents="none"or"box-none", and the unscaled area of a scaled overlay, still let the list scroll.Note
On Android, a downward drag that starts within about 12–24 dp below the status bar can be cancelled by the system (
FLAG_CANCELED, the notification-shade gesture). This is OS behavior and unrelated to this change.iphone.simulator.mov
android.emulator.mov