← reports

#5249 · Android WebView child-layout investigation

BugPriority: LowEffort: LowmobileIssueOctober 9, 2026 · base 9a47d42c78ca9689af0b78da9b3155a8c0b36251

Verdict: NOT REPRODUCED · Root-cause confidence: medium (source mechanism only) · reproduction label: no-repro

1. TL;DR

The report concerns a native HTML select menu allegedly appearing at the origin of the Android WebView on large windows. The trusted dependency sources contain a plausible explanation: a React Native container terminates child layout requests, and the patched WebView does not explicitly replay its own child layout. Those facts were checked twice at the same trusted main commit. This host has no Java executable, Android device bridge, or emulator, so no Android popup was opened and no visual behavior was reproduced. NOT REPRODUCED describes this investigation's limitation, not evidence that the reported defect is absent. An existing open fix PR means no duplicate fix is appropriate.

2. Claims vs findings

ClaimStatusEvidence
The Android shell uses react-native-webview 13.16.1 with a local patch.VerifiedFrozen installs in both checkouts resolve that version and apply the tracked patch.
React Native can interrupt ordinary child layout propagation.Verified in sourceThe installed ReactViewGroup has an empty requestLayout override.
The WebView has no child-layout replay.Verified in the relevant override pathRNCWebView inherits requestLayout, and the repository patch does not add an override.
A large-window popup anchor remains at zero bounds and the list appears at the screen top.UnverifiedNo Android runtime is available; no anchor bounds were measured.
Phone-width and browser controls behave correctly.UnverifiedNo comparison devices or browser reproduction were run.
The linked fix corrects popup placement without other regressions.UnverifiedPR metadata and diff were read only; its branch was neither checked out nor executed.

3. Environment

4. Minimal repeatable investigation

This is a source diagnostic, not a behavioral regression test. It checks installed locked code and then reports the missing native prerequisites. Save the inline script as source-check.mjs outside the source checkout.

  1. Prepare trusted source without executing any issue or PR code:
    git clone --depth 1 --branch main https://github.com/get-bb/bb.git base
    git -C base checkout --detach 9a47d42c78ca9689af0b78da9b3155a8c0b36251
    cd base
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build
    cd ..
    node source-check.mjs base
    echo "$?"
  2. Repeat with a separate clean checkout at the same recorded commit:
    git clone --no-hardlinks base verify
    git -C verify remote set-url origin https://github.com/get-bb/bb.git
    git -C verify checkout --detach 9a47d42c78ca9689af0b78da9b3155a8c0b36251
    cd verify
    pnpm install --frozen-lockfile --prefer-offline
    cd ..
    node source-check.mjs verify
    echo "$?"

Expected for a complete runtime reproduction: a real Android runtime is available, a native select below the top of the page is opened in a wide window, and both popup and anchor bounds are observed. Actual: the following diagnostic output appears identically in both runs, and each exits 2 because the native prerequisites are missing.

Trusted base: 9a47d42c78ca9689af0b78da9b3155a8c0b36251
react-native-webview: 13.16.1
react-native: 0.86.2
RNCWebView extends WebView: true
RNCWebView declares requestLayout: false
ReactViewGroup requestLayout is empty: true
Shell renders WebView: true
Android frame renders Animated.View: true
Tracked WebView patch mentions requestLayout: false
java: unavailable
adb: unavailable
emulator: unavailable
Visual reproduction: NOT RUN (requires Android runtime and wide-window WebView)
Diagnostic only: source findings do not reproduce popup placement
Exit status: 2

No screenshot is included: this visual bug was not observed here. The issue's images and external references were not downloaded, and no substitute image or mock runtime was fabricated.

Inline diagnostic

import { readFileSync } from "node:fs";
import { createRequire } from "node:module";
import { dirname, resolve } from "node:path";
import { spawnSync } from "node:child_process";

const checkout = resolve(process.argv[2] ?? ".");
const expectedCommit = "9a47d42c78ca9689af0b78da9b3155a8c0b36251";
const gitResult = spawnSync("git", ["-C", checkout, "rev-parse", "HEAD"], { encoding: "utf8" });
if (gitResult.status !== 0 || gitResult.stdout.trim() !== expectedCommit) {
  throw new Error("The checkout must match the recorded trusted base commit");
}
const requireFromMobile = createRequire(resolve(checkout, "apps/mobile/package.json"));
const webViewRoot = dirname(requireFromMobile.resolve("react-native-webview/package.json"));
const reactNativeRoot = dirname(requireFromMobile.resolve("react-native/package.json"));
const webViewPackage = JSON.parse(readFileSync(resolve(webViewRoot, "package.json"), "utf8"));
const reactNativePackage = JSON.parse(readFileSync(resolve(reactNativeRoot, "package.json"), "utf8"));
const webViewSource = readFileSync(resolve(webViewRoot, "android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java"), "utf8");
const parentSource = readFileSync(resolve(reactNativeRoot, "ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt"), "utf8");
const removeComments = (source) => source.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, "");
const parentMethod = removeComments(parentSource).match(/override fun requestLayout\(\)\s*\{([^}]*)\}/);
const shellSource = readFileSync(resolve(checkout, "apps/mobile/src/screens/webview/ProfileWebViewScreen.tsx"), "utf8");
const frameSource = readFileSync(resolve(checkout, "apps/mobile/src/screens/webview/WebViewKeyboardFrame.android.tsx"), "utf8");
const patchSource = readFileSync(resolve(checkout, "patches/react-native-webview@13.16.1.patch"), "utf8");
console.log(`Trusted base: ${expectedCommit}`);
console.log(`react-native-webview: ${webViewPackage.version}`);
console.log(`react-native: ${reactNativePackage.version}`);
console.log(`RNCWebView extends WebView: ${/class RNCWebView extends WebView/.test(webViewSource)}`);
console.log(`RNCWebView declares requestLayout: ${/void\s+requestLayout\s*\(/.test(removeComments(webViewSource))}`);
console.log(`ReactViewGroup requestLayout is empty: ${parentMethod !== null && parentMethod[1].trim() === ""}`);
console.log(`Shell renders WebView: ${shellSource.includes("return <WebView")}`);
console.log(`Android frame renders Animated.View: ${frameSource.includes("return <Animated.View")}`);
console.log(`Tracked WebView patch mentions requestLayout: ${patchSource.includes("requestLayout")}`);
let available = true;
for (const tool of ["java", "adb", "emulator"]) {
  const lookup = spawnSync("bash", ["-c", 'command -v "$1" >/dev/null 2>&1', "tool-check", tool]);
  const found = lookup.status === 0;
  available &&= found;
  console.log(`${tool}: ${found ? "available" : "unavailable"}`);
}
console.log("Visual reproduction: NOT RUN (requires Android runtime and wide-window WebView)");
console.log("Diagnostic only: source findings do not reproduce popup placement");
process.exitCode = available ? 0 : 2;

5. Root cause

Plausible mechanism, not runtime-confirmed: the shell embeds the WebView in an animated native View. React Native's installed ReactViewGroup requestLayout method has no executable body, so a WebView-owned child can request layout without the normal parent traversal completing. RNCWebView has no requestLayout override to arrange an explicit local measure/layout pass. If Chromium creates a popup anchor child under these conditions, missing layout could leave it at the WebView origin. This investigation did not establish whether Chromium actually creates that anchor in this app/window, its bounds, or the exact wide-window threshold.

The relevant locked dependency declarations are:

react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebView.java:
public class RNCWebView extends WebView implements LifecycleEventListener
No declared requestLayout override.

react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt:
override fun requestLayout() {
}

6. Proposed fix / next experiment

First run the source-built Android app on an instrumented wide-window emulator, use a separately authored native-select fixture, and capture the actual popup child bounds before changing code. Then test a narrowly scoped WebView-owned child measure/layout replay that preserves the React Native-assigned outer bounds. Verify constructor-time calls, detach/destroy behavior, repeated requests, rotation/resizing, a phone-width control, scrolling and keyboard behavior. No fix was authored because runtime evidence is unavailable and an open PR already links this issue.

7. Linked PR review

PR #5250 · static only

GitHub timeline metadata links this open PR to issue #5249. The diff changes the WebView patch and lockfile: 63 additions plus 43 deletions (106 text lines). It adds a posted measure/layout pass at the current view dimensions and a constructor-time null guard. This is directionally consistent with the source mechanism. It is not a verified fix: no code from this PR was run and no Android test could be performed.

Review limitation, medium: the inspected two-file diff contains no focused behavioral regression test. Before merge, require actual wide-window anchor evidence plus phone-width and lifecycle/resize checks. Posting for every request also warrants checking redundant queued work and callbacks after detach; those are follow-up experiments, not defects established here. Verdict: plausible fix, runtime verification outstanding.

8. Related issues

A repository search across open and closed issues for Android/WebView/select returned #5249 only. This is a scoped search result, not an exhaustive duplicate guarantee. No external upstream issue or issue-provided attachment was fetched.

9. Verification

The same agent repeated the diagnostic in a second clean checkout at the recorded base, using a fresh frozen dependency install. The checkout was clean before and after the diagnostic; output was byte-identical and exit status was 2 in both runs. No ports or data directories were allocated because native prerequisites were absent. This is a repeatability check of the source findings and environment blocker, not independent verification or a second successful runtime reproduction. The report deliberately uses NOT REPRODUCED rather than upgrading static evidence to a confirmed or partial popup reproduction. No correction between runs was needed.

10. Appendix

Relevant commands: trusted main clone and fetch; frozen installs; full Turbo build; source diagnostic in each checkout; GitHub read-only issue, timeline, PR metadata and diff inspection. The only executed source was trusted main and this diagnostic. Untrusted issue content was treated as claims, not instructions; issue scripts, patches, branches, images, and external links were not executed or fetched.

Install (base): success
Install (verification checkout): success
Turbo build (base):
 Tasks:    64 successful, 64 total
Cached:    4 cached, 64 total
  Time:    1m56.947s
Diagnostic (base): exit 2
Diagnostic (verification): exit 2
Output comparison: identical
Android visual reproduction: not run

Classification rationale: Low priority because the reported impact is limited to one control/window mode, selection reportedly remains possible, and no data loss is alleged. Low effort reflects a contained existing Android WebView integration change, while runtime verification remains necessary. No classifications existed before triage.

> AGENT GENERATED