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

Question: Dynamically set targets or attach popper a different place in the DOM #75

Closed
fredrik-sogaard opened this issue Dec 3, 2017 · 4 comments

Comments

@fredrik-sogaard
Copy link

I have a SVG with many paths were I want to show a popover on hover over each path. The problem is that the popper gets attached inside the SVG, and normal html elements won't render inside a SVG.

Is there a way to

  1. dynamically set a target so I can place one popper independently of the targets, and just updating the target on hover?
    or
  2. attach all the poppers somewhere else in the DOM so they won't end up inside the SVG?

Sorry for asking simple questions here, but I've tried to figure this out and failed.

@FezVrasta
Copy link
Member

<Manager>
  <svg>
    <Target>
      <rect />
    </Target>
  </svg>
  <Popper />
</Manager>

Can it work for you?

@fredrik-sogaard
Copy link
Author

fredrik-sogaard commented Dec 4, 2017 via email

@FezVrasta
Copy link
Member

Then you can use React portals to move the popper outside the svg

@fredrik-sogaard
Copy link
Author

Ah, thanks! I'll look into that.

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