jQuery-contextMenu icon indicating copy to clipboard operation
jQuery-contextMenu copied to clipboard

Layer passthrough event has wrong .target

Open corwin-of-amber opened this issue 6 years ago • 1 comments

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.

corwin-of-amber avatar Apr 16 '18 20:04 corwin-of-amber

Seems sensible, i'll have a look.

bbrala avatar Apr 23 '18 07:04 bbrala