svelte-virtual-list icon indicating copy to clipboard operation
svelte-virtual-list copied to clipboard

IE11 - error thrown

Open crisward opened this issue 5 years ago • 1 comments

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 avatar Mar 02 '20 10:03 crisward

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

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

crisward avatar Mar 02 '20 10:03 crisward