I currently run into an issue that I have to click twice in order to show my customized html context menu. The html context menu is hosted under a div. So I just change div’s style, i.e. display, top, left.
With a context menu opening, if clicking on some other point, only hideContextMenu will be called. I have to click again in order to trigger showContextMenu. However, if I keep clicking on the same position, the showContextMenu will be trigerred each single click.
I cannot reproduce that behavior at HTML Context Menu. In other words, I have no problems context-clicking on a node and then context-clicking on another node – the second node is selected and the HTML context menu shows immediately for the second node.
However I do notice an error when trying to change colors – we’ll fix that for the next release.
Actually, I am trying to click on same node but on different position. Only reclick on same point will invoke context menu immediately. I agree with that the sample working fine. But can you tell what is the possible reason that second click on different point of same node won’t trigger showContextMenu but only hideContextMenu? I even try to listen blur event but it doesn’t help.
Yes, that is exactly what I want. I think I do the very similar thing as what example does. I will keep investigating and reply if any found. Thanks anyway
Actually, my context menu is not html one as shown in example. I am using jquery style. That is to say, I create a dummy div for right click on it to open the context menu. The div itself is not the context menu but the host of right-click menu. The example shows me how to enable or disable a html div basically. However, how can I make it work further to trigger contextmenu on right click this div? Thanks.