Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'pageX' of null #52

Open
rajaee-rad opened this issue Feb 5, 2020 · 5 comments
Open

Cannot read property 'pageX' of null #52

rajaee-rad opened this issue Feb 5, 2020 · 5 comments

Comments

@rajaee-rad
Copy link

hi
using d3 v5 and reactjs and d3-context-menu
I'm receiving the following error:

TypeError: Cannot read property 'pageX' of null

import * as d3 from "d3";
import contextMenuFactory from "d3-context-menu";
 let contextMenu = contextMenuFactory(d3);
      var menu = [
        {
          title: "Item #1",
          action: function(d, i) {
            console.log("Item #1 clicked!");
            console.log("The data for this circle is: " + d);
          },
          disabled: false // optional, defaults to false
        },
        {
          title: "Item #2",
          action: function(d, i) {
            console.log("You have clicked the second item!");
            console.log("The data for this circle is: " + d);
          }
        }
      ];
      svgContextMenu.selectAll("g").on("contextmenu", contextMenu(menu));


@vivek0460
Copy link

I am also getting same issue, any solution?

@chakraborty-slx
Copy link

chakraborty-slx commented Apr 27, 2020

This might help #38

@nguyenlamlll
Copy link

nguyenlamlll commented Aug 30, 2020

I'm using something like this

d3.selectAll(".my_node").on('contextmenu', (d) => {
    contextMenu(menu);
});

I no longer see the property pageX error. I see one <div> and <ul> created but the context menu is empty. Probably it relates to #53

@ShiroWinG
Copy link

ShiroWinG commented Dec 9, 2020

I'm using something like this

d3.selectAll(".my_node").on('contextmenu', (d) => {
    contextMenu(menu);
});

I no longer see the property pageX error. I see one <div> and <ul> created but the context menu is empty. Probably it relates to #53

I’m having the same issue, did you end up figuring out?

@Rudgey84
Copy link

Did anybody find a solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants