Skip to content

Fix ParentView keyboard dismiss on New Architecture#703

Merged
abhijithsheheer merged 1 commit into
mainfrom
fix-keyboard-dismiss-on-new-arch
Jul 7, 2026
Merged

Fix ParentView keyboard dismiss on New Architecture#703
abhijithsheheer merged 1 commit into
mainfrom
fix-keyboard-dismiss-on-new-arch

Conversation

@abhijithsheheer

Copy link
Copy Markdown
Contributor

No description provided.

The dismiss-on-tap handler read the Paper-only (and dev-only)
_internalFiberInstanceHandleDEV from the event target, which does not
exist on Fabric — the condition was always false and taps never
dismissed the keyboard on new-arch apps.

Use TextInput.State.currentlyFocusedInput() instead: public API,
works on both architectures and in release builds. A focused input
also implies the keyboard is up, so the flaky useKeyboard height
check (RN keyboardDidShow/Hide events, unreliable under Android 15
edge-to-edge) is no longer needed here.

Behavior nuance: taps on a non-focused TextInput now dismiss before
the new input grabs focus (brief flicker) — previously any TextInput
was skipped, but detecting that has no architecture-agnostic API.
@abhijithsheheer abhijithsheheer self-assigned this Jul 7, 2026
@abhijithsheheer abhijithsheheer added frontend Deals with React/JS code majorly. It can also include UI fixes without the help of the UI team. patch Releases small requests or bug fixes. labels Jul 7, 2026

@neeto-bugwatch neeto-bugwatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 NeetoBugWatch Review

I've analyzed your pull request and found some potential improvements that might be worth considering. Please review the specific line comments below for helpful suggestions.

💡 To trigger a re-review of this PR, add a comment with neeto-bugwatch-run on its own line (not inside a code block or blockquote).

Note

Verdict: Observations - 1 comment worth a look, none blocking

Click to copy prompt for AI agent
Verdict: comment

The following are code review comments from an AI reviewer that only has access
to the PR diff, not the full codebase. Treat every comment as a hypothesis,
not a fact. For each comment:

1. Investigate the verification questions against the full codebase first.
2. Go beyond the provided questions. Use your full codebase access to ask your
   own questions, check related code paths, and consider edge cases that the
   reviewer could not have seen from the diff alone.
3. Only implement the suggested fix if your investigation confirms the issue is real.
4. If the issue is not real, skip it entirely. Do not implement speculative fixes.

Prioritize by severity (critical > major > minor > trivial) and confidence score.
Only attend to comments with confidence below 0.5 if your investigation proves them valid.

[
  {
    "file_path": "src/components/ParentView.jsx",
    "line_number": 83,
    "comment": "Comparing `e.target` directly with the result of `TextInput.State.currentlyFocusedInput()` might fail in some environments (like older versions of React Native or specific Fabric configurations) because `e.target` is often a numeric tag (node handle) while the focused input reference might be an object or a different representation. Using `findNodeHandle` or comparing against the underlying native tag is usually more robust.",
    "confidence": 0.69,
    "severity": "minor",
    "suggested_fix": "Verify if e.target and currentlyFocusedInput() return comparable types (both numeric tags or both component references) across both Paper and Fabric architectures.",
    "verification_questions": [
      "In the current React Native version, does `e.target` return a numeric ID or a component reference?",
      "Does `TextInput.State.currentlyFocusedInput()` return an object that matches the type of `e.target` when the input is focused?",
      "Is `findNodeHandle` required to normalize these references for comparison?"
    ],
    "raw_confidence": 0.6,
    "specialists_agreeing": 2,
    "judge_decision": "keep"
  }
]

Comment thread src/components/ParentView.jsx
@abhijithsheheer abhijithsheheer merged commit 85d08e1 into main Jul 7, 2026
1 check passed
@abhijithsheheer abhijithsheheer deleted the fix-keyboard-dismiss-on-new-arch branch July 7, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Deals with React/JS code majorly. It can also include UI fixes without the help of the UI team. patch Releases small requests or bug fixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant