d3 / d3-drag

Drag and drop SVG, HTML or Canvas using mouse or touch input.

Home Page:https://d3js.org/d3-drag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drag Event Issue on Windows Chrome 74, related to solution for #47

interwebjill opened this issue · comments

I am experiencing the issue raised in #47 . My app works perfectly on Chrome via a touch display on Mac, but d3.drag failed when I switched to the Windows production machine. I applied the solution .touchable(navigator.maxTouchPoints), which allowed me to drag the element on a touch screen, but am now getting UncaughtTypeError: Failed to execute 'elementFromPoint' on 'Document': The provided double value is non-finite. so my drag events aren't firing.

I am using document.elementFromPoint() to detect when the dragged element is over another element:

select(document.elementFromPoint(event.sourceEvent.clientX, event.sourceEvent.clientY)).attr("id)

This is a touch drag only issue. The functionality works perfectly with a mouse.

This is not an issue related to d3.drag, but to drag events in general in more recent (#74 at the time of writing) versions of Chrome on Windows 10. The solution is here