draggable-vue-directive
draggable-vue-directive copied to clipboard
Fix ReferenceError: "TouchEvent is not defined" in Firefox
In Firefox a ReferenceError: "TouchEvent is not defined" is thrown. This commit fixes it by simply inserting "window.TouchEvent && " into the if-check in line 206
It seems like there is another problem in firefox I couldn't figure out yet. In Chrome & Edge the dragging works correctly by holding the left mouse button down and the dragging stops as soon as someone stops pressing the mouse button. In Firefox you first have to hold the mouse button and drag the draggable element, the element moves a few pixels then stops. As soon as you stop pressing the mouse button you're able to drag the element like you wish. To stop dragging the element you have to do a click with your mouse button. Would be nice if that could be fixed. I don't know if I can do that myself.
@kurtjmeyoung I also have this problem
@IsraelZablianov please, merge PR
It seems like there is another problem in firefox I couldn't figure out yet. In Chrome & Edge the dragging works correctly by holding the left mouse button down and the dragging stops as soon as someone stops pressing the mouse button. In Firefox you first have to hold the mouse button and drag the draggable element, the element moves a few pixels then stops. As soon as you stop pressing the mouse button you're able to drag the element like you wish. To stop dragging the element you have to do a click with your mouse button. Would be nice if that could be fixed. I don't know if I can do that myself.
This is in fact a issue for Firefox. I will see if I can make sense of it.
Im not the maintainer of this repository. I have not found any solution directly related to this unfortunately.
There is a compatibility problem, why so many people still use it,
@IsraelZablianov good boy, merge it!
It seems like there is another problem in firefox I couldn't figure out yet. In Chrome & Edge the dragging works correctly by holding the left mouse button down and the dragging stops as soon as someone stops pressing the mouse button. In Firefox you first have to hold the mouse button and drag the draggable element, the element moves a few pixels then stops. As soon as you stop pressing the mouse button you're able to drag the element like you wish. To stop dragging the element you have to do a click with your mouse button. Would be nice if that could be fixed. I don't know if I can do that myself.
A bug in firefox related to this attribute:
i just deleted it and attached to a custom flag in my class:
if (!initialized) {
el.removeEventListener("mousedown", (el as any)["listener"]);
handler.addEventListener("mousedown", moveStart);
el.removeEventListener("touchstart", (el as any)["listener"]);
handler.addEventListener("touchstart", moveStart, { passive: false });
// handler.setAttribute("draggable", "true");
(el as any)["listener"] = moveStart;
initializeState();
handlePositionChanged();
}
Work for me in Chrome, Safari and Firefox