Pomax / react-onclickoutside

An onClickOutside wrapper for React components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Instances Don't Register Clicks in Other Instances as "handleClickOutside()"

afewvowels opened this issue · comments

Hello, I feel like this has probably been answered before but I'm still learning React so here's my thing:

I've got a dropdown component that implements onclickoutside but when I include multiple instances of them in my header they don't register clicks inside the other dropdowns as clicks outside so they stay open (i.e. opening one dropdown then opening a second or third does not close the first dropdown). Is this because I'm using a stateless functional component to wrap the component-based dropdowns?

Thanks for this awesome wrapper and for the help!

Boy is that embarassing, I followed a tutorial and didn't import the package, everything works great, loving it!