Open lazd opened 10 years ago
It seems event listeners fire in the wrong order when useCapture = true. See this Fiddle.
useCapture = true
With this markup:
<div id="node0"> <div id="node1"> <div id="node2"> </div> </div> </div>
And with listeners added on the capture phase:
var events = new domDelegate.Delegate(document.querySelector('#node0')); events.on('click', handler0, true); events.on('click', '#node1', handler1, true); events.on('click', '#node2', handler2, true);
For an event triggered on #node2:
#node2
document.querySelector('#node2').click();
One would expect the following call order, which matches that of native event listeners.
handler0
handler1
handler2
Instead, we get:
There is fix on branch https://github.com/ftlabs/ftdomdelegate/compare/master...orangemug:fix/issue-64
This continues on work from #73 ...which in turn is waiting on PR #81 (all the PR's!)
It seems event listeners fire in the wrong order when
useCapture = true
. See this Fiddle.With this markup:
And with listeners added on the capture phase:
For an event triggered on
#node2
:One would expect the following call order, which matches that of native event listeners.
handler0
handler1
handler2
Instead, we get:
handler2
handler1
handler0