From aba49d96211455739a0f3f94af6c12a9bc203403 Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Tue, 30 Jun 2026 17:51:54 +0200 Subject: [PATCH 1/3] Drop boolean support for ScrollView keyboardShouldPersistTaps # Conflicts: # packages/react-native/Libraries/Components/ScrollView/ScrollView.js # Conflicts: # packages/react-native/ReactNativeApi.d.ts --- .../Libraries/Components/ScrollView/ScrollView.d.ts | 9 +-------- .../Libraries/Components/ScrollView/ScrollView.js | 4 +--- packages/react-native/Libraries/Lists/FlatList.d.ts | 11 ++--------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts b/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts index 5fb44404655b..9e36eeec115d 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts @@ -671,15 +671,8 @@ export interface ScrollViewProps * - 'never' (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won't receive the tap. * - 'always', the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps. * - 'handled', the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor). - * - false, deprecated, use 'never' instead - * - true, deprecated, use 'always' instead */ - keyboardShouldPersistTaps?: - | boolean - | 'always' - | 'never' - | 'handled' - | undefined; + keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | undefined; /** * Called when scrollable content view of the ScrollView changes. diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 924c5022dc47..232a1ecbfcaf 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -581,12 +581,10 @@ type ScrollViewBaseProps = Readonly<{ * catch taps, but children of the scroll view can catch taps. * - `'handled'`, the keyboard will not dismiss automatically when the tap was handled by * children, (or captured by an ancestor). - * - `false`, deprecated, use `'never'` instead. - * - `true`, deprecated, use `'always'` instead. * * @default `'never'` */ - keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled' | true | false), + keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled'), /** * When set, the scroll view will adjust the scroll position so that the first child that is * partially or fully visible and at or beyond `minIndexForVisible` will not change position. diff --git a/packages/react-native/Libraries/Lists/FlatList.d.ts b/packages/react-native/Libraries/Lists/FlatList.d.ts index a1a8aa4cb735..227220182812 100644 --- a/packages/react-native/Libraries/Lists/FlatList.d.ts +++ b/packages/react-native/Libraries/Lists/FlatList.d.ts @@ -29,15 +29,8 @@ export interface FlatListProps extends VirtualizedListProps { * - 'never' (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won't receive the tap. * - 'always', the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps. * - 'handled', the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor). - * - false, deprecated, use 'never' instead - * - true, deprecated, use 'always' instead - */ - keyboardShouldPersistTaps?: - | boolean - | 'always' - | 'never' - | 'handled' - | undefined; + */ + keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | undefined; /** * An array (or array-like list) of items to render. Other data types can be From 0c2185bec6d1a197af2471c95d11e6f5e465674d Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Tue, 30 Jun 2026 18:45:25 +0200 Subject: [PATCH 2/3] Fix bad rebase --- .../Libraries/Components/ScrollView/ScrollView.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 232a1ecbfcaf..8f218c6e5120 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -886,17 +886,6 @@ class ScrollView extends React.Component { }; componentDidMount() { - if (typeof this.props.keyboardShouldPersistTaps === 'boolean') { - console.warn( - `'keyboardShouldPersistTaps={${ - this.props.keyboardShouldPersistTaps === true ? 'true' : 'false' - }}' is deprecated. ` + - `Use 'keyboardShouldPersistTaps="${ - this.props.keyboardShouldPersistTaps ? 'always' : 'never' - }"' instead`, - ); - } - this._keyboardMetrics = Keyboard.metrics(); this._additionalScrollOffset = 0; @@ -1481,7 +1470,6 @@ class ScrollView extends React.Component { const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput(); if ( currentlyFocusedTextInput != null && - this.props.keyboardShouldPersistTaps !== true && this.props.keyboardShouldPersistTaps !== 'always' && this._keyboardIsDismissible() && e.target !== currentlyFocusedTextInput && From 9c4a128c4202073e335fb6b5f53fa9a80632581a Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Wed, 1 Jul 2026 10:47:42 +0200 Subject: [PATCH 3/3] Fix conflict --- packages/react-native/ReactNativeApi.d.ts | 31 ++++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index bfebffaa6fcf..719d9c416a33 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<20bbe8284af4b8863a39651a46b7a53a>> + * @generated SignedSource<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -4362,12 +4362,7 @@ declare type ScrollViewBaseProps = { readonly innerViewRef?: React.Ref readonly invertStickyHeaders?: boolean readonly keyboardDismissMode?: "interactive" | "none" | "on-drag" - readonly keyboardShouldPersistTaps?: - | "always" - | "handled" - | "never" - | false - | true + readonly keyboardShouldPersistTaps?: "always" | "handled" | "never" readonly maintainVisibleContentPosition?: { readonly autoscrollToTopThreshold?: number readonly minIndexForVisible: number @@ -5919,7 +5914,7 @@ export { AlertOptions, // a0cdac0f AlertType, // 5ab91217 AndroidKeyboardEvent, // e03becc8 - Animated, // 1ac00401 + Animated, // 5942de6b AppConfig, // 35c0ca70 AppRegistry, // 7ef8e53a AppState, // 12012be5 @@ -5969,9 +5964,9 @@ export { EventSubscription, // b8d084aa ExtendedExceptionData, // 5a6ccf5a FilterFunction, // bf24c0e3 - FlatList, // b5cfde24 - FlatListInstance, // 8f76f3b2 - FlatListProps, // 3725656d + FlatList, // 0f2531c9 + FlatListInstance, // f31d4744 + FlatListProps, // b8b5adf2 FocusEvent, // 850f1517 FontVariant, // 7c7558bb GestureResponderEvent, // 14d3e77a @@ -6111,18 +6106,18 @@ export { ScrollEvent, // d7abdd0a ScrollResponderType, // 079145bb ScrollToLocationParamsType, // d7ecdad1 - ScrollView, // 9c14c51c + ScrollView, // d7defbe2 ScrollViewImperativeMethods, // d3ff1532 ScrollViewInstance, // 1ba64600 - ScrollViewProps, // c92ac7be + ScrollViewProps, // 9207390b ScrollViewPropsAndroid, // 44210553 ScrollViewPropsIOS, // da991b9a ScrollViewScrollToOptions, // 3313411e SectionBase, // dca83594 - SectionList, // 626263b4 + SectionList, // f483c886 SectionListData, // e0d79987 - SectionListInstance, // 019cdaef - SectionListProps, // 4cb9dfa9 + SectionListInstance, // 1b255509 + SectionListProps, // e06b9868 SectionListRenderItem, // 466e3e87 SectionListRenderItemInfo, // d809238e Separators, // 6a45f7e3 @@ -6196,10 +6191,10 @@ export { VirtualViewMode, // 6be59722 VirtualizedList, // 68c7345e VirtualizedListInstance, // 423ee7c0 - VirtualizedListProps, // 29367911 + VirtualizedListProps, // cc8bc4c9 VirtualizedSectionList, // 9fd9cd61 VirtualizedSectionListInstance, // 12b706d5 - VirtualizedSectionListProps, // 6b9d9c05 + VirtualizedSectionListProps, // 12a58a4f WrapperComponentProvider, // 4b8c7962 codegenNativeCommands, // 628a7c0a codegenNativeComponent, // 32a1bca6