Skip to content

Conversation

@kosta
Copy link

@kosta kosta commented Dec 11, 2025

Description

At the moment, we always set aria-controls in the Popover.Trigger, even if context.open is false, i.e. when there should be no element with the given id. This is illegal: We must only provide this id if the element exists.

Fix: Only render aria-controls if context.open.

Similar logic already exists e.g. in TooltipTrigger aria-describedby

I could not find tests for this component (I can create a new test file if you want).

The functionality is already covered in the existing Storybook.

@changeset-bot
Copy link

changeset-bot bot commented Dec 11, 2025

🦋 Changeset detected

Latest commit: 239e4b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@radix-ui/react-popover Patch
radix-ui Patch

Not sure what this means? Click here to learn what changesets are.

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

@kosta kosta force-pushed the popover-set-aria-controls-only-when-open branch from 23efc22 to 239e4b2 Compare December 11, 2025 14:10
@kosta
Copy link
Author

kosta commented Jan 19, 2026

Hi! It's been a good month since I created this bugfix PR. Maybe it was overlooked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant