Skip to content

Pointer should ignore clicks on other marks #2298

Open
@mootari

Description

@mootari

Consider the following example where a bar mark is used to highlight and pick selections, with a dot mark on top that has external links.

Clicking on any of the dots (either left click to open the link directly, or right click to open the context menu) will also pin the pointer selection.

Plot.plot({
  marks: [
    Plot.barY("abcd", Plot.pointerX({x: d => d, fill: "#eee", maxRadius: Infinity})),
    Plot.dotX("abcd", {r: 30, fill: d => d, href: d => `https://google.com/?q=${d}`})
  ],
})
Image

As an aside, the pointerdown handler should perhaps only respond to "pure" left clicks (button=0 and no modifier keys pressed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions