Skip to content

feat(AnchoredOverlay): allow overlay to reflow - #5210

Merged
francinelucca merged 8 commits into
mainfrom
3420-prcanchoredoverlay-example-overlay-has-fixed-width
Nov 7, 2024
Merged

feat(AnchoredOverlay): allow overlay to reflow#5210
francinelucca merged 8 commits into
mainfrom
3420-prcanchoredoverlay-example-overlay-has-fixed-width

Conversation

@francinelucca

@francineluccafrancinelucca commented Nov 1, 2024

Copy link
Copy Markdown
Member

Closeshttps://github.com/github/primer/issues/3420

Adds support for the changes introduced in #5129 for AnchoredOverlay to allow overlay to reflow on small viewport sizes. Also modifies Overlay's reflow logic to always allow the overlay to reflow when the content of the overlay exceeds the size of the viewport, independently of which width is used. This guarantees accessibility in terms of WCAG 2.2 Success Criterion 1.4.10 Reflow (Level AA)

Changelog

New

  • Adds new preventOverflow prop to AnchoredOverlay's *.docs.json file
  • Ports over Overlay's preventOverflow prop to AnchoredOverlay

Changed

  • Do not take width into consideration for Overlay's reflow (reflow at all sizes if enabled)
  • Update js Docs to account for new reflow behavior
  • Adds preventOverflow={false} to AnchoredOverlay's stories to allow reflow
  • Modify AnchoredOverlay's stories that use hoverCard to set the min-width on the overlay instead of the hoverCard container (this helps with reflow)

Removed

  • Removes outdated reflow-width test

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

Go to playground and width AnchoredOverlay stories and resize the browser, notice the reflow on small viewports. Compare to production.

Merge checklist

@changeset-bot

changeset-botBot commented Nov 1, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6202c7b

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

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

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

Copy link
Copy Markdown
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 1, 2024
@github-actions

github-actionsBot commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js98.53 KB (+0.03% 🔺)
packages/react/dist/browser.umd.js98.87 KB (-0.04% 🔽)

@primer-integration

primer-integrationBot commented Nov 1, 2024

Copy link
Copy Markdown

🟢 golden-jobs completed with status success.

@primer-integration

Copy link
Copy Markdown

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/349748

@francineluccafrancinelucca added status: review needed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed status: wip integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 5, 2024
alignmentOffset,
anchorOffset,
className,
preventOverflow = true,

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

On by default, which means the overlay will NOT reflow unless preventOverflow={false} is explicitly set as a prop on the component. This is of course overriden by the primer_react_overlay_overflow FF introduced in https://github.com/primer/react/pull/5129/files#diff-228ff69d3a08b1a41b50995af899947232eb64943d74ffd7aefd6bdd80aac449R9

@francinelucca
francinelucca marked this pull request as ready for review November 5, 2024 21:53
@francinelucca
francinelucca requested a review from a team as a code ownerNovember 5, 2024 21:53

@TylerJDevTylerJDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! 🚀

@francinelucca
francinelucca added this pull request to the merge queueNov 7, 2024
Merged via the queue into main with commit b1950f5Nov 7, 2024
@francinelucca
francinelucca deleted the 3420-prcanchoredoverlay-example-overlay-has-fixed-width branch November 7, 2024 20:17
@primerprimerBot mentioned this pull request Nov 7, 2024
@siddharthkpsiddharthkp mentioned this pull request Nov 8, 2024
4 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: AnchoredOverlayintegration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghstaffAuthor is a staff memberstatus: review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@francinelucca@TylerJDev