Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -888,17 +886,6 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
};

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;

Expand Down Expand Up @@ -1483,7 +1470,6 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput();
if (
currentlyFocusedTextInput != null &&
this.props.keyboardShouldPersistTaps !== true &&
this.props.keyboardShouldPersistTaps !== 'always' &&
this._keyboardIsDismissible() &&
e.target !== currentlyFocusedTextInput &&
Expand Down
11 changes: 2 additions & 9 deletions packages/react-native/Libraries/Lists/FlatList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,8 @@ export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
* - '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
Expand Down
31 changes: 13 additions & 18 deletions packages/react-native/ReactNativeApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<<c494852e3e55af084f6ef09c8558feae>>
*
* This file was generated by scripts/js-api/build-types/index.js.
*/
Expand Down Expand Up @@ -4362,12 +4362,7 @@ declare type ScrollViewBaseProps = {
readonly innerViewRef?: React.Ref<InnerViewInstance>
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
Expand Down Expand Up @@ -5919,7 +5914,7 @@ export {
AlertOptions, // a0cdac0f
AlertType, // 5ab91217
AndroidKeyboardEvent, // e03becc8
Animated, // 1ac00401
Animated, // 5942de6b
AppConfig, // 35c0ca70
AppRegistry, // 7ef8e53a
AppState, // 12012be5
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading