-
Notifications
You must be signed in to change notification settings - Fork 180
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
[BUG] Joystick not appearing in correct location when used in the svelte framework #181
Comments
I found a resolution by calculating the bounding box of the parent.
Before I go through the effort of making a pull request, I just want to check in with people who know this project better than me to make sure this is a sensible solution that won't cause weird edgecases. I don't really understand the expected behavior or when position.x and position.y will be falsy so I don't know if Here's a repl of the full code with changes working as expected: https://svelte.dev/repl/bbd65fbe0e5b4898a291e924dfb51db0?version=3.46.4 |
Thanks for the details and the repro! I think everything resides on how the position of the zone is computed by the browser, due to But, we have to understand why it's doing that when using I'm checking a bit more. |
Created #182, let me know if that fixes your issue. |
Released in v0.9.1 |
this still doesnt solve the problem unfortunately |
Describe the bug
When nipplejs is used in svelte, the joystick does not appear in the correct div "zone". Instead is appears on the top left of the page.
To Reproduce
bind:this
on the desired svelte component within onMountExpected behavior
I would expect the joystick to appear where the click occurs
Screenshots, Codepen or JSFiddle
![nipplejs_issue](https://user-images.githubusercontent.com/25193070/158915121-22c3ed44-6577-4880-b287-5b9375812e03.gif)
I created a REPL replicating the issue here by manually copying each file in nipplejs.
https://svelte.dev/repl/202b5c890c9849b5be8e8ec13b36532d?version=3.46.4
Desktop (please complete the following information):
Additional context
I am new-ish when it comes to svelte so maybe there's a better way to link to elements.
The text was updated successfully, but these errors were encountered: