Skip to content

Bug - NavItem - Icons don't show if there are complex children #11092

Closed as not planned

Description

@rebeccaalpert

Describe the problem
The NavItem lets you show an icon. However, this breaks if you pass in a child with a div.

How do you reproduce the problem?
If you give any NavItem a child that's wrapped in a div, the icon won't show: https://codesandbox.io/p/sandbox/agitated-babycat-rvrw7v?file=%2Findex.tsx%3A32%2C21&workspaceId=f5599198-6a68-44b3-85bd-1caed5609909

If you remove the div, the icon comes back.

Expected behavior
Icon should display consistently.

Is this issue blocking you?
No!

Activity

  1. moved this from Needs triage to Backlog in PatternFly Issueson Oct 3, 2024
  2. removed their assignment
    on Nov 6, 2024
  3. github-actions commented on Jan 7, 2025

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

  4. modified the milestones: 2024.Q4, 2025.Q1 on Jan 14, 2025
  5. thatblindgeye commented on Feb 6, 2025

    @thatblindgeye
    Contributor

    This looks to be expected behavior when passing custom content like this. At the very least we should update documentation to make this clearer, with the possibility of revisiting this behavior.

  6. thatblindgeye commented on Feb 10, 2025

    @thatblindgeye
    Contributor

    Will close this out as expected behavior. If others start bringing this up we can revisit this, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions