draggable-vue-directive icon indicating copy to clipboard operation
draggable-vue-directive copied to clipboard

Fix ReferenceError: "TouchEvent is not defined" in Firefox

Open kurtjmeyoung opened this issue 5 years ago • 8 comments

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 avatar Feb 11 '20 15:02 kurtjmeyoung

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 avatar Feb 11 '20 15:02 kurtjmeyoung

@kurtjmeyoung I also have this problem

quanengineering avatar May 26 '20 02:05 quanengineering

@IsraelZablianov please, merge PR

NikitchenkoSergey avatar Jun 30 '20 13:06 NikitchenkoSergey

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 avatar Aug 27 '20 14:08 cmcleese

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

cmcleese avatar Nov 05 '20 09:11 cmcleese

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

xiaoqingb avatar Mar 09 '21 11:03 xiaoqingb

@IsraelZablianov good boy, merge it!

xiaoqingb avatar Mar 09 '21 11:03 xiaoqingb

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

Ruinevo avatar May 31 '21 11:05 Ruinevo