Removed the globals root and bodyElement in favor of always setting and clearing events on this.getDOMNode().ownerDocument.body.
Removed isTouchDevice and the either/or relationship between touch and mouse events in favor of tracking the source device on a per-drag basis. This tracking relies on having separate handlers for touch and mouse events; For the record, my earlier approach of just inspecting event.type in the shared handlers did not pan out, because TestUtils.Simulate doesn't seem to set that property.
Removed dragEventFor in favor of dragEventsFor.mouse and dragEventsFor.touch.
Changed the semantics of state.dragging slightly - its value is now always one of false, 'touch' and 'mouse'. This is mainly so that a stray mouseup doesn't interfere with an ongoing touch-based drag operation, and vice versa.
Added tests that use simulated touch events alongside the existing ones for mouse events. (All tests pass on my machine, but please see #7)
In this PR, I have:
root
andbodyElement
in favor of always setting and clearing events onthis.getDOMNode().ownerDocument.body
.isTouchDevice
and the either/or relationship between touch and mouse events in favor of tracking the source device on a per-drag basis. This tracking relies on having separate handlers for touch and mouse events; For the record, my earlier approach of just inspectingevent.type
in the shared handlers did not pan out, becauseTestUtils.Simulate
doesn't seem to set that property.dragEventFor
in favor ofdragEventsFor.mouse
anddragEventsFor.touch
.state.dragging
slightly - its value is now always one offalse
,'touch'
and'mouse'
. This is mainly so that a straymouseup
doesn't interfere with an ongoing touch-based drag operation, and vice versa.