Skip to content

fix(styles): add relative positioning to radio to prevent scroll jump#6317

Open
wingkwong wants to merge 1 commit intorc-2from
fix/radio-group
Open

fix(styles): add relative positioning to radio to prevent scroll jump#6317
wingkwong wants to merge 1 commit intorc-2from
fix/radio-group

Conversation

@wingkwong
Copy link
Member

@wingkwong wingkwong commented Mar 16, 2026

Closes #

📝 Description

Originally reported from Discord here

React Aria renders a visually hidden inside an absolutely-positioned . Without position: relative on the .radio element, the hidden input gets positioned relative to a distant ancestor, causing the browser to scroll when focusing it on click. Adding relative to the .radio base class contains the absolute positioning within the radio component's bounds.

Reproducible code in Electron:

<div
    style={{
        overflowY: "scroll",
        display: "flex",
        flex: 1,
        flexDirection: "column",
    }}
>
    <div style={{ minHeight: 1000 }}></div>

    <RadioGroup orientation="horizontal">
    <Radio value="Value 1">
        <Radio.Control>
            <Radio.Indicator />
        </Radio.Control>
        <Radio.Content>
            <Label>The first value</Label>
            <Description>Click me for a bug</Description>
        </Radio.Content>
    </Radio>

    <Radio value="Value 2">
        <Radio.Control>
            <Radio.Indicator />
        </Radio.Control>
        <Radio.Content>
            <Label>The second value</Label>
            <Description>Click me for a bug</Description>
        </Radio.Content>
    </Radio>
    </RadioGroup>
</div>

⛳️ Current behavior (updates)

pr6317-before.webm

🚀 New behavior

pr6317-after.webm

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

@wingkwong wingkwong added the ♿ Scope: v3 Related to HeroUI v3 label Mar 16, 2026
@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
heroui Ready Ready Preview, Comment Mar 16, 2026 11:29am
heroui-sb Ready Ready Preview, Comment Mar 16, 2026 11:29am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: b3d3fdb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 16, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@heroui/react@6317
npm i https://pkg.pr.new/@heroui/styles@6317

commit: b3d3fdb

@wingkwong wingkwong marked this pull request as ready for review March 16, 2026 11:50
@wingkwong wingkwong requested a review from jrgarciadev as a code owner March 16, 2026 11:50
@wingkwong wingkwong changed the base branch from rc-2 to v3 March 17, 2026 04:00
@wingkwong wingkwong changed the base branch from v3 to rc-2 March 17, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♿ Scope: v3 Related to HeroUI v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant