rooks icon indicating copy to clipboard operation
rooks copied to clipboard

useOutsideClick capture phase

Open espretto opened this issue 2 years ago • 2 comments

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

espretto avatar Apr 26 '22 13:04 espretto

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.

espretto avatar Jul 26 '22 07:07 espretto

Yes please . A PR would help immensely.

imbhargav5 avatar Jul 31 '22 09:07 imbhargav5

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.

stale[bot] avatar Mar 20 '23 09:03 stale[bot]