Skip to content

Conversation

@mattcosta7
Copy link
Contributor

When enabled, applies contain: layout style to Portal elements to improve rendering performance by isolating layout and style calculations. The containment does not clip overflow, so dropdowns/tooltips continue to work correctly.

  • Added useFeatureFlag check in Portal component
  • Added useLayoutEffect to apply/remove containment based on flag
  • Added comprehensive tests for the feature flag behavior

Closes #

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

When enabled, applies `contain: layout style` to Portal elements to improve
rendering performance by isolating layout and style calculations. The containment
does not clip overflow, so dropdowns/tooltips continue to work correctly.

- Added useFeatureFlag check in Portal component
- Added useLayoutEffect to apply/remove containment based on flag
- Added comprehensive tests for the feature flag behavior
@mattcosta7 mattcosta7 self-assigned this Dec 22, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

🦋 Changeset detected

Latest commit: eb45335

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 22, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7363 December 22, 2025 03:40 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-7363 December 22, 2025 03:44 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-7363 December 22, 2025 03:51 Abandoned
@mattcosta7 mattcosta7 changed the title Add primer_react_css_contain_portal feature flag WIP: Add primer_react_css_contain_portal feature flag Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants