0

I have a dijit tree with a context menu. The user can use the keyboard keys to navigate the tree, up and down arrow keys to move, left and right to open and close nodes, as described in the documentation. However pressing the context menu key (or Shift-F10) opens the tree context menu and the browser's context menu at the same time. In most browsers the browser menu interferes and you need to press Esc to hide it. Right clicking with the mouse opens only the tree context menu.

This is a JSFiddle that showcases the issue. It is the same as the example in the reference page. In my case I attach the menu programmatically:

menu = new Menu({
    targetNodeIds: ["menutree"],
    selector: ".dijitTreeNode"
});

Is it possible to disable the browser's context menu only for those tree nodes where the menu is attached and not the whole application?

pgianna
  • 715
  • 1
  • 7
  • 16
  • an event is fired when browser context menu is shown. You can listen to this event and check if the focus is on your tree grid. If so stop browser event else leave the event as it is. Hope this helps. – bajji Jul 05 '17 at 15:39
  • I can prevent the event but I still want the tree context menu to appear. Like it happens when you right click with the mouse. – pgianna Jul 05 '17 at 19:41
  • You know what!! I tested your jsfiddle in my IE and Firefox and when Shift-F10 is pressed, I see, only treegrid context menu. If I do Shift-F10 twice on the same node (say India), I see both browser and treegrid context menu. – bajji Jul 05 '17 at 20:44

0 Answers0