Uh oh!
There was an error while loading. Please reload this page.
Conversation
…id-gesture (#49520) # Why Fixes#49510. On Android, a drag that starts on a `TextInput` inside a Compose `Host` does not scroll the surrounding `ScrollView`. The same drag started in the gap between two inputs scrolls, and both drags scroll outside a `Host`. The cause is a claim/release flip inside a single move event: 1. [`ReactEditText.onTouchEvent`](https://github.com/facebook/react-native/blob/v0.86.3/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt#L296-L320) calls `requestDisallowInterceptTouchEvent(true)` on `ACTION_DOWN`, then `(false)` on the first `ACTION_MOVE` when the field cannot scroll its own content — the ordinary single-line case. 2. `TouchDispatchingRootViewGroup` forwards both to its parent, which is Compose's `AndroidViewHolder`. 3. That sets `PointerInteropFilter.disallowIntercept`. On the initial pass the filter dispatches the move into the hosted view and **consumes** it; on the final pass `changes.fastAny { it.isConsumed } && !disallowIntercept` now holds — it reads its own consumption as a Compose claim and calls `stopDispatching`, sending `ACTION_CANCEL` into the hosted subtree. 4. The React Native subtree receives nothing more for that gesture, so the `ScrollView` never scrolls. A drag from the gap never flips the flag, so it never reaches step 3 — which is exactly the asymmetry in the report. # How `TouchDispatchingRootViewGroup` no longer forwards a `requestDisallowInterceptTouchEvent(false)` to Compose after a `true` in the same gesture. The latch resets on `ACTION_DOWN`. React Native ancestors inside the wrapper still receive the release; Compose clears its own flag when the gesture ends. **Tradeoff worth a maintainer's call:** the latch also stops a Compose parent, such as `HorizontalPager`, from taking over a gesture that began on a hosted `TextInput`. Compose cancels that subtree today, so nothing usable is lost in practice — but it is a real behavioural change, which is why this is a draft. # Test Plan Measured A/B on a hosted Android emulator with EAS `preview` builds, using the same slow 800 ms drag in both arms: | Arm | Gesture | Stock | Patched | | --- | --- | --- | --- | | No sheet, no `Host` | drag from an input | scrolls | scrolls | | No sheet, in `Host` | drag from an input | **no scroll** | scrolls | | No sheet, in `Host` | drag from the gap | scrolls | scrolls | | No sheet, in `Host` | tap an input | focuses | focuses | | universal `BottomSheet` | drag from an input | **no scroll** | scrolls | | Compose `ModalBottomSheet` | drag from an input | **no scroll** | scrolls | | universal `BottomSheet` | drag on the drag handle | dismisses | dismisses | A downward drag from a `TextInput` also scrolls the hosted list back up on the patched build, so the fix is not direction-specific. `forwardedDisallowIntercept` was confirmed present in the patched APK's dex and absent from the stock one. In `packages/expo-ui`: `typecheck` clean, `lint --max-warnings 0` clean, `pnpm test` 31 suites / 174 tests passing. # Checklist - [x] `CHANGELOG.md` entry added. - [ ] `HorizontalPager` tradeoff above needs a maintainer's sign-off. --- Diagnosis and fix by `@expo-bot` via `/verify --fix` on #49510 (branch `expo-bot:verify/49510-33192081914`); it withheld the PR because three open PRs touch `RNHostView.kt`. I checked those diffs — #48355 adds `dispatchTouchEventToJS`/`reissueCancel`, and #49427/#49483 are `matchContents` layout. None touch `requestDisallowInterceptTouchEvent`, so this is not a duplicate. Co-authored-by: expo-bot <expo-bot@users.noreply.github.com>
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )