-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Our page uses some fairly complex D3, but we've noticed an issue that can be consistently reproduced even in simple examples.
Steps to reproduce:
- (On a Mac)
control + click
on any draggable item or background, which opens a context menu; - Click outside of the context menu to close it
- You're now in a dragging state, even though you released the click.
- click again to escape the drag state.
This doesn't happen when you replace the first step with a regular right-click; so we expect it might have something to do with the meta-key control
being involved in the process that lets the key-down event trigger, but doesn't register the key-up event and thus thinks it's in drag state until a new click event is dispatched.
We made this codepen as an example. In its current form it uses microlibraries, but it gave the same results when importing the latest version of the full d3 library (v5)
https://codepen.io/anon/pen/rEdmRZ
And any example from https://github.com/d3/d3/wiki/Gallery that includes dragging, such as:
http://bl.ocks.org/robschmuecker/7880033
https://observablehq.com/@d3/versor-dragging
http://bl.ocks.org/shunpochang/66620bad0e6b201f261c