Skip to content

[iOS][Fabric] Reset keyboard inset state when recycling ScrollViews - #57791

Draft
RealBhupesh wants to merge 1 commit into
react:mainfrom
RealBhupesh:agent/57755-reset-keyboard-insets
Draft

[iOS][Fabric] Reset keyboard inset state when recycling ScrollViews#57791
RealBhupesh wants to merge 1 commit into
react:mainfrom
RealBhupesh:agent/57755-reset-keyboard-insets

Conversation

@RealBhupesh

Copy link
Copy Markdown

Fixes #57755

Summary

  • Keep automaticallyAdjustKeyboardInsets synchronized with the current props on every Fabric ScrollView update.
  • Disarm keyboard handling when a view enters the recycle pool.
  • Cancel active scroll-view animations and restore both content and vertical indicator insets from the current props.

Root cause

Fabric recycles RCTScrollViewComponentView instances while their keyboard notification observer remains registered. The keyboard opt-in flag and keyboard-managed indicator inset were not reset during recycling, so a later ScrollView could inherit keyboard behavior or an in-flight animation from the previous component.

Changelog:

[IOS] [FIXED] - Prevent keyboard inset state from leaking through recycled Fabric ScrollViews

Test Plan

  • ./node_modules/.bin/clang-format --dry-run --Werror packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
  • git diff --check
  • ./node_modules/.bin/prettier --list-different "./**/*.{js,md,yml,ts,tsx}"
  • iOS native tests were not run locally because this environment has Command Line Tools but not the Xcode app; upstream CI should run the native test matrix.

Fixes react#57755

Reset keyboard-managed state and cancel active animations when a Fabric ScrollView is recycled so later views cannot inherit keyboard insets.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS][Fabric] automaticallyAdjustKeyboardInsets state survives ScrollView recycling; recycled views apply keyboard insets they never opted into

1 participant