Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot convert undefined or null to object #25

Open
imns opened this issue Jan 18, 2017 · 3 comments
Open

Uncaught TypeError: Cannot convert undefined or null to object #25

imns opened this issue Jan 18, 2017 · 3 comments

Comments

@imns
Copy link

imns commented Jan 18, 2017

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
Copy link
Author

imns commented Jan 26, 2017

Anyone have any input on this?

@autarc
Copy link
Owner

autarc commented Jan 27, 2017

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

@androbwebb
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants