Skip to content

The default filter should return false if event.ctrlKey. #62

@JHStoops

Description

@JHStoops

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:

  1. (On a Mac) control + click on any draggable item or background, which opens a context menu;
  2. Click outside of the context menu to close it
  3. You're now in a dragging state, even though you released the click.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions