Open MustaphaGheribi opened 10 months ago
@MustaphaGheribi this is because RadioGroup inspects and injects props into its children which are Radio or RadioCard components:
I'm curious why do you need to wrap your Radio components in a div?
@adidahiya here's an example usecase
<div className="dialogContent">
<div className="wrapper">
<RadioGroup
onChange={handleRadioGroupChange}
selectedValue="optionOne"
>
<div className="radioContainerOne">
<Radio
label="Option 1"
value="optionOne"
name="groupOne"
className="customRadioStyle"
/>
</div>
<div className="radioContainerTwo">
<div className="rowStyle">
<Radio
label="Option 2"
value="optionTwo"
name="groupOne"
className="customRadioStyle"
/>
</div>
</div>
</RadioGroup>
</div>
</div>
@MustaphaGheribi I see your HTML, but what are you functionally trying to achieve with the extra div elements here?
@adidahiya the divs are there for css styling.
@MustaphaGheribi what kind of styling specifically? Can you demo this in your code sandbox? Can you achieve the same styling by targeting the .bp5-radio
element in your styling code?
Environment
Question
I'm trying to setup a list of radio buttons but the onChange event doesn't seem to be firing when the radio buttons are inside divs.
Code sandbox
Steps to reproduce: