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

null as the first argument causing a TypeError #161

Open
udayanshevade opened this issue Sep 2, 2020 · 0 comments
Open

null as the first argument causing a TypeError #161

udayanshevade opened this issue Sep 2, 2020 · 0 comments

Comments

@udayanshevade
Copy link

Been relying on this great polyfill for a while, so thank you!

Just started seeing a TypeError when null is passed in as the first argument to window.scrollTo:

Uncaught TypeError: Cannot read property 'left' of null

Although null is accommodated in the utility here, it needs to be subsequently handled here once shouldBailOut(arguments[0]) evaluates to true.

I have a branch adding a few quick checks wherever the original scroll functions are called. Please let me know if this looks like it might be worth fixing. If so, I have a PR ready here #160.

Additional context: ran into this issue while using both the polyfill as well as CodeMirror, which calls window.scrollTo here.

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

Successfully merging a pull request may close this issue.

1 participant