-
Notifications
You must be signed in to change notification settings - Fork 48
Fix ReferenceError: "TouchEvent is not defined" in Firefox #43
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
Conversation
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.
quantrung9
commented
May 26, 2020
@kurtjmeyoung I also have this problem
NikitchenkoSergey
commented
Jun 30, 2020
@IsraelZablianov please, merge PR
cmcleese
commented
Aug 27, 2020
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.
cmcleese
commented
Nov 5, 2020
Im not the maintainer of this repository.
I have not found any solution directly related to this unfortunately.
xiaoqingb
commented
Mar 9, 2021
There is a compatibility problem, why so many people still use it,
image
xiaoqingb
commented
Mar 9, 2021
@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:
image
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
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