Skip to content

Commit 9fa06bf

Browse files
mdjastrzebskiclaude
andcommitted
tighten comment on blockNativeResponder disabled guard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 67ffbf2 commit 9fa06bf

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • packages/react-native/Libraries/Components/Pressable

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,9 @@ function Pressable({
340340
ref={mergedRef}
341341
style={typeof style === 'function' ? style({pressed}) : style}
342342
collapsable={false}
343-
// Disabled when `disabled` to allow touches to reach native ancestors.
344-
// Cannot use `_isJSResponder` on the native side because it is set via
345-
// RCTExecuteOnMainQueue (async), so it may not be true yet when
346-
// touchesBegan fires, causing a race condition on fast taps.
343+
// Must be false when disabled so touches reach native ancestors. Cannot
344+
// guard this on the native side via _isJSResponder — it's set async and
345+
// races with touchesBegan on fast taps.
347346
blockNativeResponder={disabled !== true && blockNativeResponder}>
348347
{typeof children === 'function' ? children({pressed}) : children}
349348
{__DEV__ ? <PressabilityDebugView color="red" hitSlop={hitSlop} /> : null}

0 commit comments

Comments
 (0)