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

Not drawing to Target when position style is "absolute" #83

Closed
Eliav2 opened this issue Mar 31, 2020 · 13 comments
Closed

Not drawing to Target when position style is "absolute" #83

Eliav2 opened this issue Mar 31, 2020 · 13 comments

Comments

@Eliav2
Copy link

Eliav2 commented Mar 31, 2020

see here(the official example with a little change): https://codesandbox.io/s/react-archer-uses-wlqxv
position: absolute not working well, and there is no option to offset arrow anchors by given property.
any help?

@Eliav2 Eliav2 closed this as completed Mar 31, 2020
@pierpo
Copy link
Owner

pierpo commented Mar 31, 2020

Hi! Why did you close your issue? Did you solve your problem?

@Eliav2
Copy link
Author

Eliav2 commented Mar 31, 2020

yes friend - I understand that I suppose to make the position of the ArecherElement absolute and not the contained div - and this will do the trick i needed, thanks!

@Eliav2 Eliav2 reopened this Mar 31, 2020
@Eliav2
Copy link
Author

Eliav2 commented Mar 31, 2020

sorry friend but i need to reopen the issue because the position: absolute does not work on ArcherElemnets as it works on div (or any other regular element).
ArcherElemnets are taking space when the position property is set to absolute and this is not correct - do you know how can i fix it?
see demonstrations: https://codesandbox.io/s/react-archer-uses-wlqxv

@pierpo
Copy link
Owner

pierpo commented Apr 14, 2020

Thank you for the example @Eliav2 that is really helpful.
What is the problem though?

I see only two problems:

  • "middle" anchor is ugly (known issue). Is that what you're talking about?
  • dragging does not refresh properly. I don't think I can solve this in general, so I think you need to re-trigger the refresh yourself with ref.refreshScreen. This lacks documentation and should be added.

@dooleyb1
Copy link

Hi @pierpo, thank you for the library. Really useful stuff. I'm having a similar use case for refreshScreen and am looking for how to use this method to force the re-render of the arrow components? Thanks 😄

@pierpo
Copy link
Owner

pierpo commented Apr 20, 2020

Hey @dooleyb1! Thank you for the kind words I really appreciate 😄

So, I added some documentation on the README about this yesterday. Can you tell me if it is enough?
If not, I can assist you more and add more documentation 😊

@dooleyb1
Copy link

That does help thank you, I can see the arrows are now being redrawn however it turns out my issue is not directly related to this. I will open a new issue now and you can take a look if you like!

@dooleyb1
Copy link

That does help thank you, I can see the arrows are now being redrawn however it turns out my issue is not directly related to this. I will open a new issue now and you can take a look if you like!

This is here - #92

@escv
Copy link

escv commented Sep 30, 2022

Hi, is there any news about the absolute-position issue. With the recent version, it is not possible to set style attributes on the ArcherElement anymore. If my boxes have an absolute position, there are no connections drawn in my case.
Many thanks and greetings

@pierpo
Copy link
Owner

pierpo commented Oct 3, 2022

Hey @escv ! I just read the thread again, and I thought it was solved.
Can you show me an example of your problem?

@escv
Copy link

escv commented Oct 4, 2022

Thank you @pierpo for the quick response. This maybe due to a misconfiguration on my side. I created a simple example with absolute positions here https://codesandbox.io/s/vigorous-bogdan-1f90bh?file=/src/App.js
Unfortunately, the arrows are not visible here. What could be the missing point here?
Many thanks and best greetings,
Andre

@pierpo
Copy link
Owner

pierpo commented Oct 5, 2022

Amazing, thank you for providing an example.

By inspecting this, I can see that something is wrong with the views. The height is 0 🤔

image

I also noticed that you use a very old version! Which can cause some layout issues. Would you be able to upgrade?

My recommendations:

  • try to play around with the style so that the containers are not 0px large
  • upgrade to more recent versions to avoid some layout issues with the elements

@pierpo
Copy link
Owner

pierpo commented Nov 6, 2022

Bumping to 4.2.0 + defining a style that sets a width+height solves your problem. Width+height is not the ideal solution but I'll let you figure out something better: my point is that it's not related to the lib 😊

@pierpo pierpo closed this as completed Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants