Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnderlineNav: Use anchoredPosition to position overflow menu #4414

Closed
wants to merge 2 commits into from

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Mar 19, 2024

Instead of keeping the position fixed, adjust the position based on the space available (by using anchoredPosition)

Prefers aligning left towards the other link, but switches to right when there is not enough space:

underlinenav-anchored-overflow.mov

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

Copy link

changeset-bot bot commented Mar 19, 2024

🦋 Changeset detected

Latest commit: 6555591

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 Patch

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

Copy link
Contributor

github-actions bot commented Mar 19, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 87.41 KB (-0.03% 🔽)
packages/react/dist/browser.umd.js 87.79 KB (+0.05% 🔺)

@siddharthkp siddharthkp added patch release bug fixes, docs, housekeeping component: UnderlineNav integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Mar 19, 2024
@siddharthkp siddharthkp marked this pull request as ready for review March 19, 2024 16:13
@siddharthkp siddharthkp requested a review from a team as a code owner March 19, 2024 16:13
@joshblack
Copy link
Member

Closes #4059, I think, if that would be helpful to add to the PR description 👀

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Hello @siddharthkp! I apologise not responding to the issue yesterday before you pushed this PR 😢

We already have an open PR #4234 to fix this and I gave feedback as well. I had issues with the CI jobs and didn't have a chance to get back to it so haven't merged that yet.

My main feedback was around when to use anchor positioning. If I am not underestimating the use cases, we don't actually need anchor positioning until we are short on space and that way, we don't have to calculate the menu position in every render when there is a resize.

Again sorry for that it is my bad that we ended up with two PRs for the same issue 😭 Would you be able to have a look at #4234 and share if you have any feedback?

@siddharthkp
Copy link
Member Author

Closing as duplicate of #4234 🎉

@siddharthkp siddharthkp deleted the sid/underlinenav-anchored-overflow branch October 4, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: UnderlineNav patch release bug fixes, docs, housekeeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants