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: 6938e21ceab0b91578aecd60363364ecea9d48c7
  • Loading branch information
yungsters authored and facebook-github-bot committed Aug 10, 2023
1 parent 75c1422 commit 3b8d35b
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 3b8d35b

Please sign in to comment.