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

Add: useClientPoint

Open endigo9740 opened this issue 1 year ago • 6 comments

Reference

https://floating-ui.com/docs/useClientPoint

Description

Positions the floating element at a given client point (x, y), usually generated by a mouse event. By default, the client’s mouse position is automatically tracked.

Props

https://floating-ui.com/docs/useClientPoint#props

endigo9740 avatar May 23 '24 00:05 endigo9740

@endigo9740 May I tackle this issue for you guys? I'm happy to contribute to Svelte libraries.

edwardnguyen225 avatar May 23 '24 02:05 edwardnguyen225

Hey @edwardnguyen225 as mentioned on Discord, this should be fine, but I'll let @Hugos68 confirm. I'll let him assign the ticket if he gives the thumbs up.

In the meantime, here's the React source to reference: https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/hooks/useClientPoint.ts

And of course feel free to browse how the other hooks have been implemented. I'm planning to review the useFocus hook tomorrow, which introduces a number of utilities that might overlap.

  • https://github.com/skeletonlabs/floating-ui-svelte/pull/99

Thanks!

endigo9740 avatar May 23 '24 03:05 endigo9740

@edwardnguyen225 Feel free to go ahead and port this hook, like Chris said you can use other hooks as well as our contribution guide to guide you, thanks!

Hugos68 avatar May 23 '24 09:05 Hugos68

@edwardnguyen225 Do you still want to take on this hook? We want to move forward with this, otherwise I'll be happy to take over.

Hugos68 avatar May 27 '24 10:05 Hugos68

@Hugos68 Apologies for the delay, I've been occupied with interviews. Please go ahead without me. I'll be sure to contribute to another feature soon.

edwardnguyen225 avatar May 27 '24 12:05 edwardnguyen225

No worries, we're just trying to move fast since we've got another project waiting for this port 👍

Hugos68 avatar May 27 '24 12:05 Hugos68