Copying my info over from my duplicate 7723.
Nesting the input inside a label is called an implicit label (including help folks search), here is an example and I have a live example at http://jsfiddle.net/studgeek/8xpYs/.
<input type="checkbox" />
I've looked at fixing it myself before I found this duplicate. Modifying it to check for a containing label when defining its buttonElement is straightforward, but there are then parts of the implementation that run into recursion problems. The solution I have that works is to dynamically move the input outside the label, but I worry those approaches may confuse developers.
That said, urkle's commit does something similar, but it also seems to have whole lot more code than mine. I'm not entirely sure why, maybe I am missing something. Next time I get a chance I will pass on my fix for comparison.