react-radio-buttons
react-radio-buttons copied to clipboard
Button outer circle is drawn incorrectly
The outer circle of the button that indicates selection is drawn with the same radius as the inner circle rendering something that looks like this:
Due to its smaller size but apparent same origin of drawing, the outer circle has displaced itself up and to the left, causing misalignment as well.
This happens with the example code also. I am not sure if there is a conflict in modules so here is my React project dependencies:
I have the same :)
Same thing, and it's definitely caused by [email protected]
.
Same issue, and I don't have bootstrap installed.
use in css "box-sizing: content-box" on parent div
You need to include iconSize
as an attribute of your RadioButton
. I set mine to 20.
<RadioButton value={value} key={index} iconSize={20} >
{display}
</RadioButton>
Neither of these solutions worked for me, but I just wrapped the RadioGroup in a div with class "radio" and used this css to hide the circles until better fixes roll in or I'm cured of laziness and make my own:
.radio > div > div > div > div > div:nth-child(2) { display: none; }
Adding the iconSize={20} solved the issue for me.
I was able to get the RadioIcon looking decent using the following:
<ReversedRadioButton pointColor={ '#0c58ca' } iconSize={ 50 } iconInnerSize={ 40 } value="five"> <span style={{ fontSize: '22px', color: 'black'}}>Five </ReversedRadioButton>
Note: In my case I needed to make the circles much larger for an easier click experience.
following on from the fix by @nightCapLounge I figured out that the problem was the box-sizing method used by bootstrap and probably a lot of other frameworks. Overriding that for just the outer div of the rings fixed it for me.
.radio > div > div > div > div:nth-child(2)
{
box-sizing: content-box;
}