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

Add mount node/container prop to Portal and Popover to configure mount node #571

Closed
dwilt opened this issue May 1, 2020 · 1 comment
Closed
Labels

Comments

@dwilt
Copy link

dwilt commented May 1, 2020

🚀 Feature request

Current Behavior

We are currently using the Popover component for our web app popovers and would like the ability to change the container of the underlying Portal. By default, the Reach Portal appends the children to the end of the body, which is great, but in fact we'd like to be able to append it to our root app container to prevent z-index like collisions with 3rd party applications (such as Intercom)

Desired Behavior

Add a container prop to the Popover (and thus Portal component) that follow the same api as the React Portal so the node the portal is mounted to can be configured

Suggested Solution

Add container/mountNode prop to PortalProps which then bubbles up to the PopoverProps so an element, besides the end of the body, can be used as the mount node.

Who does this impact? Who is this for?

Anyone who would want to customize the mount node

Describe alternatives you've considered

  1. I've tried setting the z-index of our third party applications code but that has been difficult and will not scale.
  2. I was thinking of looking at other popover libraries which expose the mount node but we're pretty heavily invested in reach/ui so I made an issue :)

Additional context

The image below shows our app with the portal open (the large left hand floating menu).

If you look at the DOM, the <reach-portal> is after the <div id="intercom-css-container" /> and thus sits on top of the intercom widget. And since we have an invisible button to close the panel that is open, it's sitting on top of the Intercom widget preventing our users from interacting with Intercom while a portal is open.

image

@chaance chaance added Status: Consideration Type: Enhancement General improvements or suggestions labels May 2, 2020
@JakeSchroeder
Copy link

Any updates?

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

No branches or pull requests

3 participants