jxnblk / axs

Stupid simple style components for React
https://jxnblk.com/axs/
MIT License
209 stars 9 forks source link

Fix checkbox and radio click handlers #20

Closed oomathias closed 5 years ago

oomathias commented 7 years ago

Attach events handlers to the displayed component.

jxnblk commented 7 years ago

Thanks, but this looks like you've moved the input props to the element that's not the input. Am I missing something?

oomathias commented 7 years ago

Well yes, ignore this pull request as is.

But there is a problem, onClick is never called because it is attached to a hidden input.

I have the same issues with the Radio component. Were you able to control these inputs?

oomathias commented 7 years ago

You can try it here: https://esnextb.in/?gist=8cfe6cb9601083ca44d33e2ff6960c3f&exec=true Remove line 62 to see the bug.

I had to embed some code since there are no peerDependencies declared in axs and axs-ui. I will make another PR for that.

oomathias commented 7 years ago

Updated with the correct fix. onClick is now attached to the clickable component.