boblauer / react-onclickout

An ES6-friendly on-click-outside React component.
MIT License
92 stars 14 forks source link

Nested clickout components get triggered on click #13

Closed arempe93 closed 7 years ago

arempe93 commented 7 years ago

If a clickout handler is nested within another, ie:

<ClickOutHandler onClickOut={this.parentClickOut}>
    <ClickOutHandler onClickOut={this.childClickOut}>
    </ClickOutHandler>
</ClickOutHandler>

directly clicking within the nested component will trigger its onClickOut handler

Fiddle: http://jsfiddle.net/9f5edp9e/1

boblauer commented 7 years ago

Thanks for the fiddle, that helped a ton.

The fix has been published on npm, @2.0.6

arempe93 commented 7 years ago

Wow that was quick! Thanks so much @boblauer