score:3

d3 relies on the ontouchstart property for feature detection, i.e. touch event listeners are only attached if this property is present. due to changes in chrome v70 this detection mechanism seems to be broken in d3.

ontouch* apis default to disabled on desktop

to avoid confusion on touch feature detection, ontouch* members on window, document, and element are disabled by default on desktop (mac, windows, linux, chromeos). note that this is not disabling touches, and usage such as addeventlistener("touchstart", ...) is not affected.

related: disable legacy touch event apis on desktop

your laptops running windows are most likely detected as being desktop devices instead of mobile devices. hence, they are affected by those changes to chrome v70 resulting in the touch event listeners not being registered any more.

this issue has been previously reported as an issue on the d3-drag module: #47 upcoming touch detection changes in desktop chrome. once i had commented on that issue providing a reference to this question, fortunately, mike bostock replied within an hour. better still, there is an easy solution to problem: you can use drag.touchable(detector) to control when to apply touch event listeners overriding the default behavior:

touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied.

as suggested by mike drag.touchable(navigator.maxtouchpoints) seems to be a good candidate. the nuclear option drag.touchable(true) would ensure the touch event listeners be applied in any case.

score:3

open following in chrome browser

chrome://flags

and find touch events api

set touch events api to enabled (the default is now “disabled”)

hopefully this works.


Related Query

More Query from same tag