optimal-select icon indicating copy to clipboard operation
optimal-select copied to clipboard

Uncaught TypeError: Cannot convert undefined or null to object

Open imns opened this issue 8 years ago • 3 comments

I'm trying to define a function for the ignore tag property like so:

var selector = OptimalSelect.select(e.target, {
    ignore: {
        tag: function(predicate, name) {
            return (/html|body/).test(name)
        }
    }
});

It's working, but throwing an error

Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at findAttributesPattern (match.js:139)
    at findPattern (match.js:257)
    at match (match.js:100)
    at getSingleSelector (select.js:33)
    at Object.getQuerySelector (select.js:144)
    at HTMLDocument.document.addEventListener (index.html:40)

My end goal is to not select top level elements like document, html, body.

imns avatar Jan 18 '17 19:01 imns

Anyone have any input on this?

imns avatar Jan 26 '17 20:01 imns

Will take a look the next days and will fix it.

autarc avatar Jan 27 '17 08:01 autarc

Was this ever fixed? I'm getting the exact same problem.

androbwebb avatar Jan 06 '21 13:01 androbwebb