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

Fix ReferenceError: "TouchEvent is not defined" in Firefox #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kurtjmeyoung
Copy link

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

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
@kurtjmeyoung
Copy link
Author

kurtjmeyoung commented Feb 11, 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.

@quanengineering
Copy link

@kurtjmeyoung I also have this problem

@NikitchenkoSergey
Copy link

@IsraelZablianov please, merge PR

@cmcleese
Copy link

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
Copy link

cmcleese commented Nov 5, 2020

Im not the maintainer of this repository.
I have not found any solution directly related to this unfortunately.

@xiaoqingb
Copy link

There is a compatibility problem, why so many people still use it,
image

@xiaoqingb
Copy link

@IsraelZablianov good boy, merge it!

@Ruinevo
Copy link

Ruinevo commented May 31, 2021

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

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

Successfully merging this pull request may close these issues.

None yet

6 participants