0

I don't have lot of experience with web .. and i need to do something on web client.

I have some code that someone wrote in reactjs - and i want to popup menu when the user click on right click.

I wrote function that call on the right click event ( stop on this event on the right click ) and on this function i create (dynamicly) the menu.

Now i try to add this menu to the dom-> body and i don't know how to do it.
I also don't know how to add the position of the menu.

The code:

// the func event that call on right click
popupMenuOnRightClick(position){

// create the manu 
var menu = [
    {
        name: 'item1'
        title: 'itemTitle1',
        func: function()
        {
            alert('I am itemTitle1')
        }
    },

    {
        name: 'item2'
        title: 'itemTitle2',
        func: function()
        {
            alert('I am itemTitle2')
        }
    }       
];

document.body.appendChild(menu);


}

My code is nead to be popup from the react code file ( jsx file ).

Yanshof
  • 9,659
  • 21
  • 95
  • 195
  • Possible duplicate of [How to add a custom right-click menu to a webpage?](https://stackoverflow.com/questions/4909167/how-to-add-a-custom-right-click-menu-to-a-webpage) – David R May 10 '18 at 06:20
  • @DavidR: this is totaly not same question. totaly different question – Yanshof May 10 '18 at 07:06

0 Answers0