ui icon indicating copy to clipboard operation
ui copied to clipboard

Overflow Issue with Radio Group Item

Open SDBurt opened this issue 2 years ago • 2 comments
trafficstars

I have a strange issue regarding overflow and radio groups. I have been working to fix a bug for the last few hours and cannot seem to figure out why h-screen overflow-y-auto still shows a space below the body and has a scrollbar when it shouldn't.

The right scroll bar should not exist and from the background color shown in the image, something is overflowing. I narrowed it down to the RadioGroupItem component.

image

The code for this section is:

<form className="flex flex-col space-y-4">
    <Label>Style</Label>
    <RadioGroup
      defaultValue={theme.backgroundStyle}
      value={theme.backgroundStyle}
      onValueChange={styleChangedHandler}
    >
      {options.background.style.map((option) => (
        <div key={option.name} className="flex items-center space-x-2">
          <RadioGroupItem value={option.name} id={option.name} />
          <Label htmlFor={option.name}>{option.label}</Label>
        </div>
      ))}
    </RadioGroup>

removing <RadioGroupItem value={option.name} id={option.name} /> fixes the issue. I have played around with the tailwind a bunch in all areas without luck. I might remove this code and replace it with selectable cards instead, but I felt I should bring this to others attention in case they run into the same issue.

SDBurt avatar Jun 14 '23 19:06 SDBurt

Can you provide an short example where the error occurs?

dan5py avatar Jun 15 '23 14:06 dan5py

I had the same issue with RadioGroup and Select. For RadioGroup, apply className="relative", for Select, wrap it in a div with className="relative".

Palmik avatar Dec 05 '23 05:12 Palmik

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jul 02 '24 23:07 shadcn