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

Throws error when using the click method on the document #140

Open
imaustink opened this issue May 12, 2017 · 1 comment
Open

Throws error when using the click method on the document #140

imaustink opened this issue May 12, 2017 · 1 comment

Comments

@imaustink
Copy link

@imaustink commented on Mon May 08 2017

If you use .click like this f.click(document), it throws the following error.

syn.js:173 Uncaught TypeError: Cannot read property 'jQuery' of undefined
    at Function.jquery (https://unpkg.com/[email protected]/dist/global/syn.js:173:49)
    at Object.addOffset (https://unpkg.com/[email protected]/dist/global/syn.js:326:30)
    at init._click (https://unpkg.com/[email protected]/dist/global/syn.js:515:25)
    at new init (https://unpkg.com/[email protected]/dist/global/syn.js:155:27)
    at syn (https://unpkg.com/[email protected]/dist/global/syn.js:131:20)
    at Function.syn.(anonymous function) [as click] (https://unpkg.com/[email protected]/dist/global/syn.js:578:24)
    at HTMLDocument.<anonymous> (https://fiddle.jshell.net/0xxjv2o0/1/show/:49:5)
    at fire (https://code.jquery.com/jquery-2.1.3.js:3094:30)
    at Object.fireWith [as resolveWith] (https://code.jquery.com/jquery-2.1.3.js:3206:7)
    at Function.ready (https://code.jquery.com/jquery-2.1.3.js:3412:13)

JSfiddle


@chasenlehara commented on Tue May 09 2017

That looks like an issue in Syn, is it not?


@justinbmeyer commented on Tue May 09 2017

Try on the document.documentElement or document.body then.

@kdillon
Copy link
Collaborator

kdillon commented Nov 14, 2018

I agree with Justin on this one. "Document" is a bit of an ethereal concept.

Correct me if I'm wrong, but its my understanding that the first tangible node in the DOM is usually the body, which would be the recipient of the click if you wanted to click on the widest scope. There are some exceptions like frameset-based pages, but "body" is the one you usually want to click.

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

2 participants