Skip to content

Commit 4f4c0a2

Browse files
committed
docs
1 parent 5b00795 commit 4f4c0a2

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

packages/react-native/Libraries/Components/Pressable/Pressable.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ type PressableBaseProps = Readonly<{
120120
onPressOut?: ?(event: GestureResponderEvent) => unknown,
121121

122122
/**
123-
* Whether to prevent any other native components from becoming responder
124-
* while this pressable is responder.
123+
* When true, prevents native ancestor views (UIKit responder chain) from
124+
* receiving touch events when this Pressable handles a press.
125+
*
126+
* @platform ios
125127
*/
126128
preventNativePropagation?: ?boolean,
127129

packages/react-native/Libraries/Components/View/ViewPropTypes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,12 @@ type ViewBaseProps = Readonly<{
504504

505505
/**
506506
* When true, prevents native ancestor views (UIKit responder chain) from
507-
* receiving touch events when this view is the active JS responder.
508-
* Requires that the Fabric gesture recognizer has already claimed the touch.
507+
* receiving touch events when this view handles a press. Without this, UIKit
508+
* delivers touches independently to every view that received touchesBegan:,
509+
* so parent views fire touchesEnded: even when a child Pressable handles the
510+
* press.
511+
*
512+
* @platform ios
509513
*/
510514
preventNativePropagation?: ?boolean,
511515

packages/react-native/Libraries/Pressability/Pressability.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export type PressabilityConfig = Readonly<{
131131
onPressOut?: ?(event: GestureResponderEvent) => unknown,
132132

133133
/**
134-
* Whether to prevent any other native components from becoming responder
135-
* while this pressable is responder.
134+
* When true, prevents native ancestor views (UIKit responder chain) from
135+
* receiving touch events when this Pressable handles a press. iOS only.
136136
*/
137137
preventNativePropagation?: ?boolean,
138138
}>;

packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps {
108108
bool collapsableChildren{true};
109109

110110
bool removeClippedSubviews{false};
111-
bool preventNativePropagation{false};
111+
bool preventNativePropagation{false}; // iOS only
112112

113113
#pragma mark - Convenience Methods
114114

0 commit comments

Comments
 (0)