Skip to content

null as the first argument causing a TypeError #161

@udayanshevade

Description

@udayanshevade

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions