react-native-portalize icon indicating copy to clipboard operation
react-native-portalize copied to clipboard

Can't click the buttons on the screen after the modal is closed

Open borasumer opened this issue 3 years ago • 2 comments

So I am using Portalize and Modalize. Wrap one of my Stack navigations with Host, and mount the modal in one of the screens of that stack, and open and close that model in the same screen. When I close the modal, for like half a second after, I cannot click on any buttons in that screen, as if the modal is not properly being closed/unmounted even though it is not there anymore. To click any buttons after the modal is closed, I either have to double click, or wait like half a sec and then click any button on that screen, which is very odd. This only happens if I open the modal and close it. When I remove the modal code from the screen, or not open it at all, the buttons are working fine. So there is no issue with the buttons.

This is my modal:

    <Portal>
      <Modalize
        closeAnimationConfig={{
          spring: {
            tension: 0,
          },
          timing: {
            duration: 500,
          },
        }}
        ref={modalRef}
        withHandle={false}
        adjustToContentHeight={!height}
        panGestureEnabled={!disableSwipeDown}
        modalHeight={height || null}
        scrollViewProps={{
          scrollEnabled: false,
        }}
      >
        {children}
      </Modalize>
    </Portal>

And this is how I use it in the screen:

  const modalRef = useRef(null);

 <Modal modalRef={modalRef}>
       //Children to render in the modal view
        <FooterContent modalRef={modalRef} />
 </Modal>

borasumer avatar Oct 15 '21 19:10 borasumer

I think it is closeAnimationConfig. It gives you an error if you remove the timing, and if you have any timing value, no matter how much it is, you have to wait for half a sec after you close the modal to interact with the screen again. Not sure exactly what I am doing wrong here. I thought I would be able to modify the animation without getting into timing.

borasumer avatar Oct 15 '21 20:10 borasumer

I think your question has been answered here -> https://github.com/jeremybarbet/react-native-modalize/issues/224

juniorogaa avatar Jan 04 '22 13:01 juniorogaa