React-native-navigation: [iOS 13] Overlays intercept touch on iPad Pro + iPad Air

Created on 29 Jan 2020  路  10Comments  路  Source: wix/react-native-navigation

Issue Description

On iPad Pro and iPad Air models, overlays with interceptTouchOutside: false do not work as expected as they actually absorb all the touch events. This is strange because it does not happen on normal iPhones or even the standard iPad's (6th generation).

Similar closed issues:

Steps to Reproduce / Code Snippets / Screenshots

Fork with reproducible example: https://github.com/ItsNoHax/react-native-navigation/tree/reproduce-invisible-overlay

Steps:

  • Open a simulator of type: iPad Pro 3rd generation 12 inch.
  • Open the playground project and navigate to the 3rd tab: Navigation
  • Click on the Overlay button to open OverlayScreen
  • Click on Show invisible overlay
  • Try to click any buttons and notice how it's not possible
  • Re-do the steps above with a simulator of type: iPhone 11 and note how it does work

Environment

  • React Native Navigation version: 4.6.0
  • React Native version: 0.61.5
  • Platform(s) (iOS, Android, or both?): iOS 13
  • Device info (Simulator/Device? OS version? Debug/Release?): All
iOS 13 iOS acceptebug reproduction provided 馃搶 pinned

Most helpful comment

Great finds guys.. 馃憦

All 10 comments

Same for me

@guyca any updates on this issue?

Thanks

Hi,

A possible hint for solving this issue, if you go to file RNNOverlayWindow.m and take a look at this method:

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    UIView *hitTestResult = [super hitTest:point withEvent:event];

    if ([hitTestResult isKindOfClass:[UIWindow class]]) {
        return nil;
    }

    return hitTestResult;
}
  • On iPhone when you touch outside of your overlay view hitTestResult is a RNNOverlayWindow
  • On iPad touch outside of you overlay view hitTestResult is a UIView

There is some view added in the middle for iPad, I have checked all the code and doesn't seem to be anything conditional for iPad, a workaround for solving this issue temporarily is this:

 @implementation RNNOverlayWindow

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    UIView *hitTestResult = [super hitTest:point withEvent:event];

    if ([hitTestResult isKindOfClass:[UIWindow class]]) {
        return nil;
    }

        if ([[hitTestResult class] isEqual:[UIView class]]) {  <===== Added this
                return nil;
        }

    return hitTestResult;
}

@end

And it works on iOS 13 because what we really want to intercept is RCTViews not pure UIViews in my opinion

Nice find @fjmorant , hopefully @yogevbd can use this to propose a fix.

Great finds guys.. 馃憦

@yogevbd Seems like this has been lost in V5 version. Going to re-open the issue.

This also appears to be an issue on all iOS devices, not just on iPads. V6.3.1

You can see a video of the replication here: https://d.pr/v/My6YCg

@yogevbd as no-one seems to be seeing this issue. The iPad fix issued doesn't resolve.

Hey @flikQ ! 馃憢 If you could fork the library and push a reproduction to the issue to your clone, that would help us a lot debug this issue.

Was this page helpful?
0 / 5 - 0 ratings