Skip to content

Commit

Permalink
Pressability: Replace cancelable Change w/ blockNativeResponder
Browse files Browse the repository at this point in the history
Summary:
{D47225928} introduced a bug affecting `TextInput` on iOS that prevented native text editing capabilities. This reverts the change to a previous incarnation of the diff where javache created a new `blockNativeResponder` option instead of piggybacking off the existing `cancelable` option.

Changelog:
[iOS][Changed] - Restored `cancelable` option in `Pressability` configuration to not block native responder, and instead introduced a new optional `blockNativeResponder` boolean option to accomplish the same thing.

Reviewed By: mdvacca

Differential Revision: D48246530

fbshipit-source-id: 8a406d462cce0e5e5a108607e1ac1d3203ea229c
  • Loading branch information
yungsters authored and facebook-github-bot committed Aug 11, 2023
1 parent 01b9b50 commit 30e2345
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react-native/Libraries/Pressability/Pressability.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ export type PressabilityConfig = $ReadOnly<{|
*/
onPressOut?: ?(event: PressEvent) => mixed,

/**
* Whether to prevent any other native components from becoming responder
* while this pressable is responder.
*/
blockNativeResponder?: ?boolean,

/**
* Returns whether a long press gesture should cancel the press gesture.
* Defaults to true.
Expand Down Expand Up @@ -495,7 +501,7 @@ export default class Pressability {
this._handleLongPress(event);
}, delayLongPress + delayPressIn);

return this._config.cancelable === false;
return this._config.blockNativeResponder === true;
},

onResponderMove: (event: PressEvent): void => {
Expand Down

0 comments on commit 30e2345

Please sign in to comment.