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

How do you handle cases where a modal is shown from clicking in a layer #93

Open
philmetzger opened this issue Feb 6, 2023 · 2 comments

Comments

@philmetzger
Copy link

I have created a dropdown component:

const { renderLayer, triggerProps, layerProps } = useLayer({
    isOpen: isVisible,
    onOutsideClick: () => setIsVisible(false),
    overflowContainer: true,
    auto: true, // Automatically find the best placement.
    placement,
    triggerOffset: 5,
    onDisappear: (_disappearType) => {
      if (_disappearType === disappearType) {
        setIsVisible(false);
      }
    },
  });

Now in my dropdown I load a Modal. However as soon as i click anywhere in the modal, then everything closes because of
onOutsideClick: () => setIsVisible(false)

Is there a nice solution for this so if something is above the dropdown, like a modal, to ignore the click outside?

@SalahAdDin
Copy link

Same issue here with onHover, I want to keep the layer open while I'm hovering the layer itself.

@rferreira98
Copy link

rferreira98 commented Apr 10, 2024

Same issue!! I have a dialog and it closes everything on close because it propagates the event. event.stopPropagation not working. @everweij

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

3 participants