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.

react-native-navigation overlays intercept all touch events when wrapped with gestureHandlerRootHOC

See original GitHub issue

Our app is using React Native Navigation and so we’re wrapping all our screen components with gestureHandlerRootHOC. However, with React Native Navigation overlays need to be registered similarly to screens, but if we wrap our overlays with gestureHandlerRootHOC then they intercept all touch events when visible and no other part of the app can react to them. When multiple overlays are shown at once, only the top-most one reacts to touches. Even an empty overlay component will intercept all touches if it is wrapped with gestureHandlerRootHOC. Is there a way around this issue?

// registering an overlay
Navigation.registerComponentWithRedux('DashboardOverlay', () => gestureHandlerRootHOC(DashboardOverlay), Provider, store);
// showing an overlay
Navigation.showOverlay({
    component: {
        id: 'DashboardOverlay',
        name: 'DashboardOverlay',
        options: {
            overlay: {
                interceptTouchOutside: false
            }
        }
    }
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
EliSadakacommented, Mar 12, 2019

I found a workaround by passing layout props to gestureHandlerRootHoc() to override the default flex value of 1:

Navigation.registerComponentWithRedux('DashboardOverlay', () => gestureHandlerRootHOC(DashboardOverlay, {flex: 0}), Provider, store);

1reaction
gp3gp3gp3commented, Apr 13, 2020

This is still an issue with the latest gesture handler changes. It may work for modals, but overlays with a flex: 1 style will still catch all touch events (using the wix library)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass Touch Events through Overlay - Stack Overflow
Is it somehow possible to pass all touch events down from Screen B (UI with Overlay) to Screen A (Camera Screen which also...
Read more >
React Native - Dismiss Menu On Any Touch Event - ADocLib
Ask questionsreactnativenavigation overlays intercept all touch events when Our app is using React Native Navigation and so we're wrapping all our screen.
Read more >
Gesture - OSCHINA - 中文开源技术交流社区
The Orba is a small, handheld device that's a synth, looper, and controller all in one. It's shaped like a halved grapefruit, and...
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