Left click picking up parent as well as targeted child div
CraigSheppardSec opened this issue · 1 comments
Firstly thanks for this, really enjoying it.
I'm having an issue where if I set the trigger to 'right', everything works as it should; it correctly identifies the div that I've right clicked on and I can do what I need to do with that.
However if the trigger is set to 'left' it registers the click on not only the targeted child div but the underlying parent div as well. It throws an error that there's no menu for the parent div, however in some circumstances there is in which case it shows both the menu set for the child and parent.
Any ideas?
For anyone having a similar problem, it's a simple matter of adding a stopPropagation.
I have 2 different calls, one if the class is the parent div and one if the class is a child div.
Under the one for the child div...
trigger: 'left',
selector: ".[child div class name]",
build: function($trigger, e) {
e.stopPropagation();
Problem solved.