Repository navigation
Return no next view when a ScrollView's content view is gone - #59075
YevheniiKotyrlo wants to merge 1 commit into
Conversation
3d3cdc5 to
abe722d
Compare
|
Adding some production data in support of this fix. This is currently our top Android crash on RN 0.80.2 (New Architecture): 55 crashes affecting 47 users over the last 30 days, out of ~2.8k active users. The stack trace is identical: In our breadcrumbs it almost always happens right as the user navigates away from a screen that has a focused I also checked 0.88.1 and current |
|
Until this lands, an app can carry the change with |
abe722d to
7cf1acd
Compare
findNextFocusableView read host.getChildAt(0).id without checking for the child, so a focus search on a scroll view whose content view had already been removed threw a NullPointerException, as react#53046 reports for a screen navigating back with a focused TextInput. It now returns null, which leaves the platform's own answer in place. Signed-off-by: YevheniiKotyrlo <44449990+YevheniiKotyrlo@users.noreply.github.com>
7cf1acd to
7ffadce
Compare
Visual regressionNo visual differences at ios: no capture |
Summary:
ReactScrollViewHelper.findNextFocusableViewreadshost.getChildAt(0).idwithout checking for the child, so a focus search that reaches a scroll view whose content view has already been removed throws from the scroll view'sfocusSearch:#53046 reports it while a screen with a focused
TextInputin aScrollViewnavigates back, where the search runs fromTextView.onCreateInputConnectionas the input method starts on that field. The search now returnsnullwhen there is no content view, sofocusSearchkeeps the platform's answer.Changelog:
[ANDROID] [FIXED] - Fix crash in a
ScrollView's focus search after its content view has been removedTest Plan:
ReactScrollViewHelperFocusSearchTest: a vertical and a horizontal scroll view with no content view, the Fabric lookup returning a next focusable. Onmainboth fail with theNullPointerExceptionabove, thrown at thegetChildAt(0).idread; with this change both returnnull.-PenableWarningsAsErrors=true, and ktfmt is clean on both files.