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 items collapses into the more menu then it is wrapped with a flex #4297

Open
broccolinisoup opened this issue Feb 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working component: UnderlineNav react staff Author is a staff member

Comments

@broccolinisoup
Copy link
Member

Description

When UnderlineNav is placed into a flex container, even though there are enough space, items are collapsed into the menu. I suspect that is happening due to the overflow behaviour. When there is any "autonomy" given to the underlinenav container using like max-content, auto etc, it simply renders the item in less space as possible i.e. collapses them under more menu.

This is problematic when UnderlineNav is used along with other elements in the same row when styling with flex. An example is reported here in Slack (Hubber only link )

Seems like this was working fine on the v35.21.0 based on the case shared above in slack🤔

Steps to reproduce

  1. Go to any stories on underlinenav storybook
  2. Wrap the Underlinenav with a flex container like below
<Box sx={{display: 'flex'}}>
    <UnderlineNav aria-label="Repository">
      {children.map((child: string, index: number) => (
        <UnderlineNav.Item key={index} icon={child.icon} href="#" aria-current={index === 0 ? 'page' : undefined}>
          {child.name}
        </UnderlineNav.Item>
      ))}
    </UnderlineNav>
</Box>
  1. Observe the items are pulled into the menu even though there is enough space

Version

v36.9.0

Browser

No response

Copy link
Contributor

github-actions bot commented Sep 8, 2024

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
@github-actions github-actions bot added staff Author is a staff member and removed Stale labels Sep 15, 2024
@lesliecdubs
Copy link
Member

👋🏻 @broccolinisoup I saw this got reopened. Is this something you're actively working on, or do we need to run it through a more focused triage session?

@broccolinisoup
Copy link
Member Author

Hi @lesliecdubs 👋🏻 I am not actively working on it however I'd like to address this issue whenever I get a chance. I believe it is a limitation in the component though it is a very low priority. Only one team reported so far (as far as I know) and we found a workaround for them - let me know how you want to move forward with this issue - whether or not keeping it open.

@lesliecdubs
Copy link
Member

@broccolinisoup thanks for the update! I'm comfortable leaving this issue open in the Primer backlog to circle back to when you have some time. Let's move this back to the "Inbox" if other reports come through about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: UnderlineNav react staff Author is a staff member
Projects
None yet
Development

No branches or pull requests

2 participants