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

position does not work with tweened store #167

Closed
khromov opened this issue Aug 11, 2024 · 1 comment
Closed

position does not work with tweened store #167

khromov opened this issue Aug 11, 2024 · 1 comment

Comments

@khromov
Copy link

khromov commented Aug 11, 2024

Repro:
https://svelte.dev/repl/035ab677b08d48a09830d43dcab4784d?version=4.2.18

The "Dog" element is supposed to snap back to the original position if it's dragged and not placed inside the circle, however it does not work, the transform property does not change even though we are using the tweened store and can see the store is being continuously updated.

I am using exactly the same approach as the docs page:
https://github.com/PuruVJ/neodrag/blob/a9b7ac8147a4012192ff33e95d1e186ae367639b/docs/src/components/home/HeroExample.svelte#L60C4-L60C28

@khromov
Copy link
Author

khromov commented Aug 11, 2024

After some research I managed to get a hint from #122

The config is not reactive when set in a variable inside the script tag, it has to be done with an inline object on use:draggable: https://svelte.dev/repl/035ab677b08d48a09830d43dcab4784d?version=4.2.18

@khromov khromov closed this as completed Aug 11, 2024
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

1 participant