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

Make it official? #2

Open
atomiks opened this issue Dec 8, 2022 · 5 comments
Open

Make it official? #2

atomiks opened this issue Dec 8, 2022 · 5 comments

Comments

@atomiks
Copy link

atomiks commented Dec 8, 2022

Thank you for creating this ❤️ 🎈

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

@lxsmnsyc
Copy link
Owner

lxsmnsyc commented Dec 8, 2022

@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.

@atomiks
Copy link
Author

atomiks commented Dec 8, 2022

@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} />
  </>
);

@lxsmnsyc
Copy link
Owner

lxsmnsyc commented Dec 8, 2022

@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.

@atomiks
Copy link
Author

atomiks commented Dec 8, 2022

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)

@lxsmnsyc
Copy link
Owner

lxsmnsyc commented Dec 8, 2022

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

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

2 participants