Description
After the first time useDragAndDrop is called anywhere on the page, the default behavior of clicking on text is altered.
In particular, clicking on some selected text should deselect the text, but this is not the case if using this library.
This is true for Chromium based browsers but not on Firefox.
Here a reproduction link (using Vue as I am, but I don't think it matters much): https://codesandbox.io/p/devbox/headless-glade-wp6d83
I tested with both versions 0.4.2 and 0.3.4 of the library.
I am almost certain this is due to the call to preventDefault
in handleRootPointerup
function handleRootPointerup(e: PointerEvent) {
pd(e); // <--- this line
if (state.pointerDown) state.pointerDown.node.el.draggable = true;
state.pointerDown = undefined;
if (!isSynthDragState(state)) return;
const config = state.currentParent.data.config;
if (isSynthDragState(state)) config.handleEnd(state);
}
but I'm not sure how to fix this problem without breaking other features.
Currently, I am running a patched version of the package that just ignores the whole rootPointerup
handler.
Thank you for the great library and the work you put into it!
Let me know if you need any other info!