Skip to content

[ScrollView] keyboardShouldPersistTaps="handled" doesn't work #3926

@gigobyte

Description

@gigobyte

Description

The RNGH ScrollView doesn't count Pressable taps or Gesture.Tap() taps as handled in the context of keyboardShouldPersistTaps. This is both on iOS and Android.

For the purpose of demonstration I set up the same example with RN components and RNGH components:

Screen.Recording.2026-01-19.at.21.09.55.mov

Here is the code:

import {
  Pressable as RNPressable,
  ScrollView as RNScrollView,
  TextInput as RNTextInput,
} from 'react-native'
import {
  Pressable as RNGHPressable,
  ScrollView as RNGHScrollView,
  TextInput as RNGHTextInput,
} from 'react-native-gesture-handler'

 <RNScrollView
  keyboardShouldPersistTaps="handled"
  contentContainerStyle={{ height: 200, backgroundColor: 'red' }}
>
  <RNPressable
    style={{ width: 100, height: 100, backgroundColor: 'green' }}
    onPress={() => {}}
  >
    <RNTextInput value="RN input" />
  </RNPressable>
</RNScrollView>

<RNGHScrollView
  keyboardShouldPersistTaps="handled"
  contentContainerStyle={{ height: 200, backgroundColor: 'blue' }}
>
  <RNGHPressable
    style={{ width: 100, height: 100, backgroundColor: 'green' }}
    onPress={() => {}}
  >
    <RNGHTextInput value="RNGH input" />
  </RNGHPressable>
</RNGHScrollView>

Steps to reproduce

  1. Run the code from the description
  2. Tap the text input to focus it
  3. Tap on the green Pressable, the keyboard shouldn't hide

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

Gesture Handler version

2.30.0

React Native version

0.81

Platforms

iOS, Android

JavaScript runtime

None

Workflow

None

Architecture

New Architecture (Fabric)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions