Skip to content

fix(react-headless-components-preview): adopt anchored container queries for arrow placement#36112

Open
mainframev wants to merge 4 commits intomicrosoft:masterfrom
mainframev:fix/headless-popover-implementation
Open

fix(react-headless-components-preview): adopt anchored container queries for arrow placement#36112
mainframev wants to merge 4 commits intomicrosoft:masterfrom
mainframev:fix/headless-popover-implementation

Conversation

@mainframev
Copy link
Copy Markdown
Contributor

@mainframev mainframev commented May 6, 2026

  • Supports the JS-driven data-placement attribute as source of truth for popover-arrow styling with a CSS-native solution based on Chrome 143+'s anchored container queries (container-type: anchored + @container anchored(fallback: …)). The placement-observer still runs on older Chromium so arrow direction stays correct on older versions.

  • fix: tightened public type surface for PositioningProps unsupported features

  • refactored usePlacementObserver to use a debounce

@mainframev mainframev changed the title fix(react-headless-components-preview): fix(react-headless-components-preview): improve placement-observer May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-headless-components-preview
react-headless-components-preview: entire library
107.577 kB
31.646 kB
108.294 kB
31.902 kB
717 B
256 B

🤖 This report was generated against 6411342ccfa1a14f414d13af9881c61788bafd7e

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Pull request demo site: URL

@mainframev mainframev force-pushed the fix/headless-popover-implementation branch from 25dee94 to f815971 Compare May 6, 2026 19:17
refactor(headless-popover): refactor implementation
@mainframev mainframev force-pushed the fix/headless-popover-implementation branch from f815971 to 1bd5814 Compare May 6, 2026 20:20
@mainframev mainframev force-pushed the fix/headless-popover-implementation branch 2 times, most recently from c18c393 to 3550016 Compare May 6, 2026 22:02
@mainframev mainframev changed the title fix(react-headless-components-preview): improve placement-observer fix(react-headless-components-preview): adopt anchored container queries for arrow placement May 6, 2026
@mainframev mainframev self-assigned this May 6, 2026
@mainframev mainframev force-pushed the fix/headless-popover-implementation branch from 3550016 to c11b03b Compare May 6, 2026 22:07
@mainframev mainframev marked this pull request as ready for review May 6, 2026 22:10
@mainframev mainframev requested a review from a team as a code owner May 6, 2026 22:10

if (win && supportsAnchoredContainerQueries(win)) {
// Chrome 143+: opt into `@container anchored(fallback: …)` queries.
node.style.setProperty('container-type', 'anchored');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant