Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
borasumer opened this issue Oct 15, 2021 · 2 comments
Open

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

borasumer opened this issue Oct 15, 2021 · 2 comments

Comments

@borasumer
Copy link

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
Copy link
Author

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.

@juniorogaa
Copy link

I think your question has been answered here -> jeremybarbet/react-native-modalize#224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants