Closed joukosaastamoinen closed 8 years ago
Thanks for the details, and the jsfiddle. Fixed and publish on npm @1.2.1
There is another certain issue on react >= 15
data-reactid
was removed in 15 version
Yes, that's on my todo list to fix. Pull requests are welcome!
I was shopping for a component like this for use with ES6 classes, and discovered a bug when I read the source.
If you have this:
And you click the
.red
element, the_handleGreenClickOut
does not get called, and vice-versa.This is because by the time the click event bubbles up to
window
, its__isClickIn
is set totrue
if the click happened inside anyClickOutHandler
: https://github.com/boblauer/react-onclickout/blob/master/src/index.jsx#L26Here's a fiddle: http://jsfiddle.net/twq0d65y/3/