naugtur / insertionQuery

Non-dom-event way to catch nodes showing up. And it uses selectors.
Other
193 stars 32 forks source link

strictlyNew = false error #24

Closed bormat closed 7 years ago

bormat commented 7 years ago

Hi, Setting strictlyNew to false seems to create the error "Cannot read property 'parentNode' of null(…)" The incriminated function is topmostUntaggedParent which continue recursive call even when they are no parentNode. I use chrome.

<div class="b0 test"></div>

<script>
    insertionQ.config({
        strictlyNew : false,
        timeout : 0,
    });
    insertionQ('.test').summary(function(arrayOfInsertedNodes){
        console.log(arrayOfInsertedNodes)
    });
    setTimeout(function(){
        $('<div class="b1 test"></div>').appendTo('body')
    },1000)

</script>

Thanks

naugtur commented 7 years ago

hmm... it was supposed to recognize when it reaches the top. Thanks for reporting, I'll look into it.

naugtur commented 7 years ago

Fixed, published v1.0.4