Mateusz Burzyński

Results 1531 comments of Mateusz Burzyński

Hm, I see your problem - by the time onClickOutside handler get called your node is already detached from the DOM. I'm not sure if using capture phase by default...

I've chosen this based on other popular solutions. Don't have a specific answer for this, if this brings you any trouble I might consider making this configurable

Couldnt u move tooltip outside of the button element in this example?

I could accept a PR to make this particular thing configurable.

Could you describe an example use case in more detail?

But you never want to close any of them if a user clicks inside any of them? Do those modals stack/overlap?

This seems like a rather less popular use case. I would recommend composing this in your codebase like this: ```js export default (refs, handler) => refs.forEach(ref => useOnClickOutside(ref, handler)) ```...

Right - no of the proposes approaches would work for you. I still believe that this use case is rather niche though and I wouldn't like overloading the implementation. If...

I'm afraid that's not possible without hacks. React doesn't give access to its tree and we can't just traverse it.

@diegohaz this is interesting, would you be able to prepare a simple codesandbox showcasing how this could be used? I'm not sure if I understand how this is supposed to...