-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
does not rebind when domTarget changes #17
Comments
I have the same problem, is there any progress on this? |
An error occurs when a component is mounted after the component initialization:
Using with onMounted(() => {
useDrag(dragHandler, {
domTarget: dragEl,
});
}); |
You may need to rebind when the component is visible, the following code works fine on my side.
|
This issue seems to be quite prevalent and, unfortunately, it significantly blocks using the library in real life. For those considering contributing with a PR, the problematic area can be found here: Controller.ts. As a point of reference, Floating UI addresses a similar challenge gracefully using watchers. You can see their approach here: Floating UI :: useFloating, where they utilize: watch([referenceElement, floatingElement], attach, {flush: 'sync'}); Hope, this might offer some inspiration for a solution. |
I use if/else on the domTarget and when it toggled, the gesture event stopped working. Is there a way to make it reactive? I try to call useGesture() again in watcher but it still does not solve my issue
The text was updated successfully, but these errors were encountered: