solid-floating-ui icon indicating copy to clipboard operation
solid-floating-ui copied to clipboard

Make it official?

Open atomiks opened this issue 2 years ago • 5 comments

Thank you for creating this ❤️ 🎈

Are you interested in placing this under @floating-ui/solid?

atomiks avatar Dec 08 '22 03:12 atomiks

@atomiks Hi! Thanks for notifying.

I would certainly love to move it to the official repo, but I think I would need to focus first on implementing the Interactions API, which seems to be a lot more complex.

lxsmnsyc avatar Dec 08 '22 04:12 lxsmnsyc

@lxsmnsyc it's okay that it doesn't support interactions, just the positioning is fine. If created, that would be a separate package like @floating-ui/solid-interactions, but yeah, the interactions package is vastly more complex and is still in v0, so it wouldn't make sense to translate it especially as it's in flux still.

Regarding the API, is it possible to match @floating-ui/react-dom like this if it makes sense, or better to use external signals? In React you can access the elements via position.refs.reference.current:

const position = useFloating();

return (
  <>
    <div ref={position.reference} />
    <div ref={position.floating} />
  </>
);

atomiks avatar Dec 08 '22 04:12 atomiks

@lxsmnsyc it's okay that it doesn't support interactions, just the positioning is fine. If created, that would be a separate package like @floating-ui/solid-interactions, but yeah, the interactions package is vastly more complex and is still in v0, so it wouldn't make sense to translate it especially as it's in flux still.

I see, that makes sense. I do feel the urge to work on it given that I'm also working on solid-headless.

Regarding the API, is it possible to match @floating-ui/react-dom like this if it makes sense, or better to use external signals? In React you can access the elements via position.refs.reference.current:

I did consider it initially however given that Solid doesn't have refs, reference and floating is going to be a setter function ((ref: T) => void) but the thing is, users won't be able to access the underlying ref value, hence why the current API design is to delegate the ref assignment to the user and the user must pass the value to the useFloating function instead.

I am open to discuss this further.

lxsmnsyc avatar Dec 08 '22 05:12 lxsmnsyc

I see, that makes sense 👍

It should be relatively straightforward to duplicate the react-dom folder as solid in Floating UI's repo and replace files with the index.ts file you've created — the build setup should work with it. Would you be willing to make a PR?

After that, we can create a documentation page on the website (which will likely be similar to your current README)

atomiks avatar Dec 08 '22 05:12 atomiks

Yes, that's sounds great. I'll do it in my free time, thanks!

lxsmnsyc avatar Dec 08 '22 06:12 lxsmnsyc