jQuery-contextMenu
jQuery-contextMenu copied to clipboard
Layer passthrough event has wrong .target
To allow closing the menu when clicking outside, jQuery-contextMenu puts a helper layer on top of the document. When it's clicked, jQuery-contextMenu cleverly sends the mouse event to the element right beneath it to mimic what would happen if the layer was not there. This may address some of the concerns raised by #532.
One flaw, though, is that the 'target' property of the event is the layer, not the delegated element. This can easily be fixed by adding e.target = target
here. (Not making a push request since the change is so small.)
I tried changing e.originalEvent.target
as well, but unfortunately it had no effect.
Seems sensible, i'll have a look.