question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<RectButton> becomes unresponsive when used within a List

See original GitHub issue

Description

Using a RectButton in a List component (FlatList/SectionList) will become unresponsive in certain scenarios. I am not sure whether this is an incorrect usage of this library or it’s something new with RN. This wasn’t an issue in production before.

  • It’s observed that the event handler is not called when it’s unresponsive
  • It’s observed that when RectButton is unresponsive, it’s also unresponsive to swipe up to close the android app
  • It’s observed that using the same example, it cannot be reproduced on Snack
  • Finally, setting shouldActivateOnStart=true on RectButton seems to solve the issue
  • Additionally, I initially thought it’s because I’m not using RectButton inside RNGH’s ScrollView so I’ve added a SectionList export via patch-package. This also seems to solve the issue other than setting shouldActivateOnStart=true.

Platforms

  • iOS
  • Android
  • Web

Screenshots

https://user-images.githubusercontent.com/23186058/183584450-ceebbea3-9298-4fb4-abcf-b0bf30b29cd5.mov

https://user-images.githubusercontent.com/23186058/183584650-a8e130da-a4db-4100-94f3-fcbbed814f91.mov

Steps To Reproduce

Using RN’s SectionList

  1. Scroll multiple times to the bottom of the list
  2. All <RectButton> instances become unresponsive
  3. Navigate to “Solution” by pressing the button in Header
  4. All <RectButton shouldActivateOnStart> instances are still responsive (however the ripple effect is gone)
  5. Exit and reload the app and navigate straight to “Solution” and repeat Step 1
  6. Everything works fine

Using re-exported SectionList by overriding its ScrollViewComponent with RNGH’s ScrollView via renderScrollComponent

  1. Apply the package by running yarn patch-package
  2. Scroll multiple times to the bottom of the list
  3. Everything works fine

Expected behavior

  • RectButton does not become unresponsive when used within a List component on Android

Actual behavior

  • RectButton becomes unresponsive when used within a List component Android

Snack or minimal code example

https://github.com/nujhong/RNGH-RectButton-In-a-List

Package versions

  • React: 18.0.0
  • React Native: 0.69.1
  • React Native Gesture Handler: 2.5.0
  • React Native Reanimated: 2.9.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nujhongcommented, Aug 24, 2022

An update that is hopefully useful @j-piasecki

This seems to be a problem specific to react-native-gesture-handler@2.5.0 + Android 12, without regards to react-native, as Expo SDK 46 also bumped it from 2.2.0 to 2.5.0.

For the peers, we eventually downgraded it to 2.3.2 and it works for us without any workarounds now.

1reaction
hirbodcommented, Sep 8, 2022

@itsramiel yes, in my example, you can also see that I can’t even press the top right header button. It was only working when I added shouldActivateOnStart. I’m back to business now, I will try to pull in the draft to see if that resolves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested touchables don't work correctly on Android #784
Everything works fine in iOS but Android is trigger both onPress events ... <RectButton> becomes unresponsive when used within a List #2160.
Read more >
React-Native Button onPress not working - Stack Overflow
When I refresh the page, I get the alert without clicking on the button and after I close the alert and click on...
Read more >
Buttons | React Native Gesture Handler - Software Mansion
Gesture handler's buttons recognize touches in native which makes the recognition ... Below is a list of properties specific to RectButton component: ...
Read more >
OpenWindows Desktop Reference Manual - Oracle Help Center
This section is provided as a guidance on use. This section lists special rules, features and commands that require in-depth explanations. The subsections....
Read more >
An Independent Measurement System for Performance ...
Certain commercial entities, equipment, or materials may be identified in this document in order to describe.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found