Wrong element is getting event listeners.
necat1 opened this issue · 0 comments
necat1 commented
When I have div with click event listener:
<div id="1"></div>
And I construct new document with added div above previous one, so new document looks like:
<div></div>
<div id="1"></div>
So when i replace current document with new document, event listener is now on div without id, and div with id 1 has no event listener:
diff(document, newDoc);
But when div with id is above the newly added element, than the div keeps the event listener like expected:
<div id="1"></div>
<div></div>