Skip to content

Header: add overflow - #4768

Merged
siddharthkp merged 2 commits into
mainfrom
header-add-overflow
Aug 1, 2024
Merged

Header: add overflow#4768
siddharthkp merged 2 commits into
mainfrom
header-add-overflow

Conversation

@siddharthkp

@siddharthkpsiddharthkp commented Jul 23, 2024

Copy link
Copy Markdown
Member

We recommend rethinking how this component's CSS is implemented. While it currently focuses primarily on making sure items are vertically aligned, it does not account for cases where the content is wider than the viewport. This may require further design consideration (for instance, forcing content to break to a new line whenever there is insufficient space).

BeforeAfter
When there a lot of items, the Header makes the page grow wider and adds a scrollbarWhen there are a lot of items, the Header becomes scrollable without making the page wider
When there a lot of items, the Header makes the page grow wider and adds a scrollbarWhen there are a lot of items, the Header becomes scrollable without making the page wider

Note: This is a bit of a silly fix because it's not common at all to have a scrollable Header.

However, this component however is an outdated pattern that is barely used: 6 instances in dotcom out of 0 are as it's intended usage as a navigation header. 5 in other places. We have alternatives like UnderlineNav that are recommended.

So this feels like a safe change to make to pass an accessibility review without getting into a rabbit hole about correct usage or deprecation in this PR

@changeset-bot

changeset-botBot commented Jul 23, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1dcfabb

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

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

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

@siddharthkpsiddharthkp self-assigned this Jul 23, 2024
@github-actionsgithub-actionsBot added the staff Author is a staff member label Jul 23, 2024
@github-actions

github-actionsBot commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js92.35 KB (-0.02% 🔽)
packages/react/dist/browser.umd.js92.71 KB (+0.03% 🔺)

@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.

Looks good!

I see there's some differing opinions on if 1.4.10 Reflow passes with a scrollbar in one dimension or if all content should be fully present in the viewport. I think this is a good approach, and if we need to iterate further in the future we can. I don't think we need to go the strict route since the usage of this component is limited, and part of the responsibility is on the consumer, at least for now.

@siddharthkp
siddharthkp added this pull request to the merge queueAug 1, 2024
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Aug 1, 2024
@siddharthkp
siddharthkp added this pull request to the merge queueAug 1, 2024
Merged via the queue into main with commit b7c90eaAug 1, 2024
@siddharthkp
siddharthkp deleted the header-add-overflow branch August 1, 2024 15:31
@primerprimerBot mentioned this pull request Aug 1, 2024
@primerprimerBot mentioned this pull request Oct 18, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibilityreactstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@siddharthkp@joshblack@TylerJDev