fedorovvvv / svelte-floating-ui

Svelte✨ Floating UI 🎈
MIT License
151 stars 8 forks source link

Add support for virtual elements #6

Closed giacomoran closed 1 year ago

giacomoran commented 1 year ago

Hi,

Virtual elements are not supported since ReferenceAction only accepts HTMLElement.

The type signature for ReferenceAction is:

type ReferenceAction = (node: HTMLElement) => void;

For instance, in svelte-popperjs the type signature is:

type ReferenceAction = (
    node: Element | VirtualElement | Readable<VirtualElement>
) => {
    destroy?(): void;
};

Do you plan to add support for virtual elements?

fedorovvvv commented 1 year ago

Hi, yes, this is a wonderful functionality Thank you for writing about him✨

It is added in the new release 1.2.7 A new block in the documentation has also been added to it🎈