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
The drag behavior should support pointer events. #2556
Milestone
Comments
stnor
changed the title
Microsoft Edge on Windows 10
Drag event doesnt fire on Microsoft Edge on Windows 10
Sep 15, 2015
This works on IE11 and Chrome but not Edge. drag = d3.behavior.drag()
.on("dragstart", function(d, i) {
console.log("got it") I also added a console.log in d3 3.5.6 (which prints): d3.behavior.drag = function() {
var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
//var pointerdown = dragstart(d3_noop, d3.touch, d3_window, "pointermove", "pointerdown")
function drag() {
this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart) //.on("pointerdown.drag", pointerdown);
}
function dragstart(id, position, subject, move, end) {
return function() {
console.log("*** DRAGGING")
var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId);
if (origin) {
dragOffset = origin.apply(that, arguments);
dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
} else {
dragOffset = [ 0, 0 ]; |
Possible duplicate of #2403? |
mbostock
changed the title
Drag event doesnt fire on Microsoft Edge on Windows 10
The drag behavior should support pointer events.
Dec 3, 2015
Related #1439. |
This was referenced Dec 3, 2015
My code works now on Edge both in d3 v3 and v4. Tested on Edge 38.14393 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Dragstart, Dragend and Drag events doesn't seem to fire on Microsoft Edge (the new browser in Windows 10) on a Microsoft Surface 3 Pro touch device.
Code works great on IE9-IE11. Does d3 support pointer-events?
If you need more information or help testing, I'd be glad to assist.
Thanks!
The text was updated successfully, but these errors were encountered: