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

IE11 - error thrown #39

Open
crisward opened this issue Mar 2, 2020 · 1 comment
Open

IE11 - error thrown #39

crisward opened this issue Mar 2, 2020 · 1 comment

Comments

@crisward
Copy link

crisward commented Mar 2, 2020

https://github.com/sveltejs/svelte-virtual-list/blob/master/VirtualList.svelte#L122

.scrollTo only exists on window in IE. So this cause an error to be thrown.

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo

This can be fixed by adding a check first

viewport.scrollTo && viewport.scrollTo(0, scrollTop + d);

Apart from that, works fine in IE. If you'd prefer this in the form of a pull request, let me know.

@crisward
Copy link
Author

crisward commented Mar 2, 2020

BTW looks like it could be just as easy to use scrollTop instead.

https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop

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

1 participant