Eliav2 / react-xarrows

Draw arrows (or lines) between components in React!
https://codesandbox.io/embed/github/Eliav2/react-xarrows/tree/master/examples?fontsize=14&hidenavigation=1&theme=dark
MIT License
584 stars 75 forks source link

Z-Index #80

Closed pmorim closed 3 years ago

pmorim commented 3 years ago

Is your feature request related to a problem? Please describe. I tried to render the arrow behind a component by doing something like this:

<XArrow passProps={{ style: { zIndex: -1 } }} ... />

But it doesn't work. Is there any way to do it at the moment?

Describe the solution you'd like There should be a zIndex prop that would be passed to the svg components of the arrow. Something like this:

<XArrow zIndex={-1} ... />

Describe alternatives you've considered

Additional context I want a way for the connection to be displayed behind the little gray circles.

image

I'm using this library for a university project, so I really need a solution for this, even if it is just a hacky workaround.

BKurzawa commented 3 years ago

@pmorim Try using divContainerStyle={{ zIndex: -1}}

pmorim commented 3 years ago

@BKurzawa thank you, you are a lifesaver. But I still think there should be a zIndex prop.

Eliav2 commented 3 years ago

does divContainerStyle={{ zIndex: -1}} worked perfectly it your case? considering adding this prop because it is common to use in arrow component @pmorim

Eliav2 commented 3 years ago

suggestion accepted

Eliav2 commented 3 years ago

added in dev branch