rooks
rooks copied to clipboard
useOutsideClick capture phase
I was surprised to find that useOutsideClick
registers its listeners for the capture
phase of the event (which makes things harder in my specific use-case). It would've been helpful to have this documented and why.
https://github.com/imbhargav5/rooks/blob/00b92839a5149f6920e2f031e7d2f1b4466e1765/src/hooks/useOutsideClick.ts#L31
I'd like to change the API of useOutsideClick
and make the third argument an options object extending the AddEventListenerOptions
interface to include the existing option when
. That way the user has more control over the event binding.
I would put up a pr for this, if desirable.
Yes please . A PR would help immensely.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.