rebassjs/rebass

Label onClick Called Twice

amaster507 opened this issue · 1 comments

I believe this to be related to this closed issue: #57

When I add an onClick on a Label element it is called twice.

https://codesandbox.io/s/dank-rgb-on5rg?file=/src/App.js

<Label
  sx={{ cursor: "pointer" }}
  onClick={event => console.log("Trigered Twice: ", event.target)}
>
  <Checkbox /> Will Get Called Twice
</Label>
<Label sx={{ cursor: "pointer" }}>
  <Checkbox
    onClick={event => console.log("Triggered Once: ", event.target)}
  />{" "}
  Only gets called Once
</Label>

Ah, this is probably a misunderstanding on my part. I researched on and found that is how it works with plain JavaScript with a label wrapping an input element. I updated the sandbox to demonstrate. I will close this issue as it is not Rebass specific