Fix ParentView keyboard dismiss on New Architecture#703
Merged
Conversation
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.
There was a problem hiding this comment.
🤖 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"
}
]
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.
No description provided.