Skip to content

fix(popover): merge content props through getFloatingProps (#806)#2023

Open
kotAPI wants to merge 1 commit into
mainfrom
fix/issue-806-popover-content-floating-props
Open

fix(popover): merge content props through getFloatingProps (#806)#2023
kotAPI wants to merge 1 commit into
mainfrom
fix/issue-806-popover-content-floating-props

Conversation

@kotAPI

@kotAPI kotAPI commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Popover content merges consumer props via getFloatingProps

Fixes #806

Test plan

  • npm test -- --testPathPatterns=Popover.test

Summary by CodeRabbit

  • Bug Fixes
    • Improved Popover component's handling of styling and attribute precedence to ensure consistent behavior.

Pass content props into getFloatingProps so outside interaction handlers
compose with consumer attributes.

Fixes #806
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dee0c90

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

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de27220e-a7c7-4cbc-a39e-c643c8997ba6

📥 Commits

Reviewing files that changed from the base of the PR and between fe87b36 and dee0c90.

📒 Files selected for processing (1)
  • src/core/primitives/Popover/fragments/PopoverPrimitiveContent.tsx

📝 Walkthrough

Walkthrough

In PopoverPrimitiveContent, the getFloatingProps call is updated to accept id, role, data-state, data-side, data-align, aria-hidden, a merged style object, and ...props as its argument. The rendered Primitive.div now only spreads the single returned floatingProps object, removing all previously separate attribute and prop spreads from the JSX.

Changes

Popover Primitive Content — Prop Getter Consolidation

Layer / File(s) Summary
Consolidate attrs and props into getFloatingProps call
src/core/primitives/Popover/fragments/PopoverPrimitiveContent.tsx
getFloatingProps is now invoked with an explicit object containing id, role, data-state, data-side, data-align, aria-hidden, merged style, and ...props. The Primitive.div JSX only spreads the returned floatingProps, removing separate attribute and ...props spreads from the element.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • rad-ui/ui#1910: Introduced PopoverPrimitiveContent with the original getFloatingProps usage that this PR refactors.

Suggested reviewers

  • GoldGroove06

Poem

🐇 Hop, hop, the props now flow,
Through getFloatingProps they go!
No more spreading here and there,
One tidy getter, clean and fair.
The floating-ui docs are pleased, I'd say —
A rabbit tidied props today! 🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: merging content props through getFloatingProps in the Popover component.
Linked Issues check ✅ Passed The PR directly addresses issue #806 by ensuring consumer props are passed through getFloatingProps() instead of spread directly on elements, following Floating UI's documented pattern.
Out of Scope Changes check ✅ Passed The changes are limited to the PopoverPrimitiveContent component and focus solely on moving props into getFloatingProps() call as required by issue #806.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-806-popover-content-floating-props

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

This report compares the PR with the base branch. "Δ" shows how the PR affects each metric.

Metric PR Δ
Statements 75.73% +0.00%
Branches 59.17% +0.00%
Functions 61.75% +0.00%
Lines 77.26% +0.00%

Coverage improved or stayed the same. Great job!

Run npm run coverage:ci locally for detailed reports and target untested areas to raise these numbers.

@kotAPI

kotAPI commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Code review

LGTM. Matches project patterns for portal Theme refs, Floating UI prop merge, controlled-switch/lazy-mount/RTL tests, or focused bug fixes. No changes requested.

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.

BUG: Event handlers and props should be passed to getReferenceProps and not the element itself

1 participant