Radio: onChange not triggered for radio toggle with id
Bug Report
onChange not triggered on Radio with toggle and id props. And does okay without id or with name props.
Steps
- Add
idandtoggleprops to Radio component - Click on radio element
Expected Result
onChange should be triggered.
Actual Result
onChange is not triggered.
Version
0.87.3
Testcase
https://codesandbox.io/embed/semantic-ui-react-example-yowvx
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Seems like it was intentional? https://github.com/Semantic-Org/Semantic-UI-React/blob/9bcc76a82cd02fd4e0cbc9afdef8904af04dcf91/test/specs/modules/Checkbox/Checkbox-test.js#L244
Would it not work for you with the onClick? It works with your example.
So I've investigated this a bit, and just like @MiceXx said, apparently in PR the id was disabled to avoid calling the onChange handler twice. But the side effect in turn has caused this to not fire when id is provided. So what I'm going to do instead of this, is to e.preventDefault() see if it can fix the issue without breaking the "onChange firing twice" fix.
has any fix made for this?