Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

Closes https://github.com/github/primer/issues/6090

In React 19, forwardRef usage results in overlayProps.ref being null more frequently. When spreading overlayProps after the ref prop, this null value overwrites the internal updateOverlayRef, breaking overlay positioning.

Changelog

Changed

  • AnchoredOverlay now merges overlayProps.ref with internal ref using custom callback instead of allowing prop spread to overwrite
  • Added assignRef utility to handle both callback refs and ref objects

Testing

Added test coverage for:

  • Ref objects passed via overlayProps.ref
  • Callback refs passed via overlayProps.ref

Rollout strategy

  • Patch release

Merge checklist


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: 51bbd60

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

Copilot AI changed the title [WIP] Fix AnchoredOverlay to not overwrite ref from prop spread fix(AnchoredOverlay): prevent ref overwrite from overlayProps spread Nov 5, 2025
Copilot AI requested a review from joshblack November 5, 2025 18:02
@joshblack joshblack closed this Nov 5, 2025
@joshblack joshblack deleted the copilot/sub-pr-7130 branch November 5, 2025 18:21
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.

2 participants