Skip to content

Pressable onPress not working inside horizontal FlatList when RTL is enabled #51032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hassan-hossini opened this issue Apr 30, 2025 · 4 comments
Labels
Component: FlatList Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Type: Unsupported Version Issues reported to a version of React Native that is no longer supported

Comments

@hassan-hossini
Copy link

Description

Environment:

React Native version: [0.76.6]

Platform: Android

RTL: Enabled (I18nManager.forceRTL(true))

FlatList: horizontal={true}

Affected components: Pressable, FlatList

Description:

When using a horizontal FlatList in an RTL (right-to-left) layout, the onPress event of a Pressable component inside the list item does not trigger reliably. This issue seems to occur particularly on Android, and only when RTL is enabled.

Expected Behavior:

Pressing on a Pressable inside a horizontal FlatList in RTL mode should consistently trigger the onPress event.

Actual Behavior:

Touch interactions (especially onPress) are not registered. It seems like either the gesture responder system is blocked or the touch area is misaligned. This behavior does not occur in LTR layout or when using ScrollView.

Reproducible Sample Code:
`import React from 'react';
import { FlatList, I18nManager, Pressable, Text, View } from 'react-native';

I18nManager.forceRTL(true); // RTL mode enabled

const data = Array.from({ length: 10 }, (_, i) => Item ${i});

export default function App() {
return (
<FlatList
horizontal
data={data}
keyExtractor={(item) => item}
renderItem={({ item }) => (
<Pressable
onPress={() => console.log('Pressed:', item)}
style={{
width: 100,
height: 100,
margin: 10,
backgroundColor: 'lightblue',
justifyContent: 'center',
alignItems: 'center',
}}
>
{item}

)}
/>
);
}
`

Notes:

The issue disappears when switching to LTR mode.

Switching from Pressable to TouchableOpacity sometimes mitigates the issue, but it's inconsistent.

Removing horizontal or switching to ScrollView avoids the problem but isn't ideal for large lists.

Disabling inverted or tweaking contentContainerStyle didn’t resolve the issue.

Would you like me to help you create a GitHub issue from this, or do you want to post it yourself?

Steps to reproduce

.

React Native Version

0.76.6

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: Windows 10 10.0.19045
  CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  Memory: 2.65 GB / 7.90 GB
Binaries:
  Node:
    version: 22.13.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 11.1.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-242.23339.11.2421.12483815
  Visual Studio: Not Found
Languages:
  Java: 17.0.12
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

.

MANDATORY Reproducer

https://github.com/facebook/react-native/

Screenshots and Videos

No response

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Type: Unsupported Version Issues reported to a version of React Native that is no longer supported labels Apr 30, 2025
@react-native-bot
Copy link
Collaborator

Warning

Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

@react-native-bot
Copy link
Collaborator

Warning

Unsupported version: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


You can read more about about it on our website: How to report a bug.

@andrewpmsmith
Copy link

Also noticed this too. Was able to workaround using onTouchEnd rather than onPress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: FlatList Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Type: Unsupported Version Issues reported to a version of React Native that is no longer supported
Projects
None yet
Development

No branches or pull requests

3 participants