instea/react-native-popup-menu

RN CRASH when triggering visibility on popover that is no longer in viewport

preyansh98 opened this issue · 2 comments

I have a simple popover, for which the visibility is set by the opened prop:

    <Menu
      opened={visible}
      onClose={onClose}
      onBackdropPress={onClose}
      renderer={renderers.Popover}
      rendererProps={{ placement: 'bottom' }}
    >
      <MenuTrigger>
        {children}
      </MenuTrigger>
      <MenuOptions>
        {content}
      </MenuOptions>
    </Menu>

Now let's set flyout visibility to true, after a certain timeout, for example:
setTimeout(() => coachmark.visibility = true, 2000))

Steps to reproduce:

  • Like with the code snippet above, set opened to true after a certain timeout
  • Within this timeout, scroll away to not have the trigger item in the viewport
  • React Native crashes.

Exception found:
From logging, seems to be an invariant violation exception with top: NaN and left: NaN.

{"name":"Invariant Violation","error":"[1965,\"RCTView\",21,{\"padding\":7,\"backgroundColor\":0,\"position\":\"absolute\",\"alignItems\":\"center\",\"transform\":[{\"scale\":0.1}],\"opacity\":0.1,\"top\":\"<<NaN>>\",\"left\":\"<<NaN>>\",\"flexDirection\":\"column\",\"pointerEvents\":\"box-none\"}] is not usable as a native method argument","data":{"componentStack":"\n    in RCTView (at View.js:34)\n    in View (at createAnimatedComponent.js:)\n    in AnimatedComponent (at createAnimatedComponent.js:)\n    in ForwardRef(AnimatedComponentWrapper) (created by Popover)\n    in Popover (created by MenuPlaceholder)\n    in RCTView (at View.js:)\n    in View (created by MenuPlaceholder)\n    in MenuPlaceholder (created by MenuProvider)\n    in RCTView (at View.js:)\n    in View (at SafeAreaView.js:)\n    in ForwardRef(SafeAreaView) (created by MenuProvider)\n    in RCTView (at View.js:)\n    in View (created by MenuProvider)\n 

Facing same issue any solution on this?

Same issue for me , any update😥