scroll-into-view / compute-scroll-into-view

Utility for calculating what should be scrolled, how it's scrolled is up to you
https://scroll-into-view.dev#scroll-alignment
MIT License
308 stars 27 forks source link

Virtual element support #902

Open luin opened 1 year ago

luin commented 1 year ago

Thanks for the great library!

I'd like to integrate this library in Quill but the usage is to scroll a range into view. I think it makes sense to support a virtual element as well in addition to Element. A virtual element is basically an object providing the following methods:

interface VirtualElement {
  getBoundingClientRect(): DOMRect;
  getParentElement(): HTMLElement;
}

I can create a PR if that something you want to support.