Pressability: Replace cancelable Change w/ blockNativeResponder

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
This commit is contained in:
Tim Yung
2023-08-10 17:53:58 -07:00
committed by Facebook GitHub Bot
parent 01b9b509cf
commit 30e2345b26
@@ -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.
@@ -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 => {