-
Notifications
You must be signed in to change notification settings - Fork 645
chore: fix UnderlineWrapper html structure #7097
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
chore: fix UnderlineWrapper html structure #7097
Conversation
🦋 Changeset detectedLatest commit: dc0f77e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
👋 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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the default element type for UnderlineWrapper from 'nav' to 'div'. The UnderlineWrapper is a shared internal component used by both UnderlineNav and UnderlinePanels components.
Key Changes
- Changed the default
asprop value inUnderlineWrapperfrom'nav'to'div'
|
|
||
| export const UnderlineWrapper = forwardRef((props, ref) => { | ||
| const {children, className, as: Component = 'nav', ...rest} = props | ||
| const {children, className, as: Component = 'div', ...rest} = props |
Copilot
AI
Oct 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the default element from 'nav' to 'div' is a breaking change that affects semantic HTML structure. The UnderlineNav component relies on this default to render as a
element, which is critical for accessibility. The test at line 67 in UnderlineNav.test.tsx expects a element, and tests at lines 68, 74, and 125 use getByRole('navigation') which will fail with this change. UnderlineNav explicitly passes as='nav' (line 144 in UnderlineNav.tsx), so this change should not break functionality, but the change removes semantic meaning from UnderlinePanels which doesn't pass an 'as' prop. Consider if this is intentional or if the default should remain 'nav' with UnderlinePanels explicitly passing as='div' if needed.| const {children, className, as: Component = 'div', ...rest} = props | |
| const {children, className, as: Component = 'nav', ...rest} = props |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/5896 |
|
🟢 ci completed with status |
Looks like UnderlineWrapper went from being a "div" to a "nav" in https://github.com/primer/react/pull/6874/files, reverting back to "div".
Changelog
New
Changed
divinstead ofnavRollout strategy
Testing & Reviewing
Merge checklist