From be7fb7c1dfe3335e18647022061f6f2ec4ce2850 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Thu, 12 Mar 2026 20:12:55 +0000 Subject: [PATCH 1/8] fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item --- packages/react/src/ActionList/LinkItem.tsx | 27 +++++--- .../react/src/Breadcrumbs/Breadcrumbs.tsx | 61 +++++++++---------- .../__tests__/Breadcrumbs.test.tsx | 35 +++++++++++ packages/react/src/NavList/NavList.test.tsx | 1 + 4 files changed, 84 insertions(+), 40 deletions(-) diff --git a/packages/react/src/ActionList/LinkItem.tsx b/packages/react/src/ActionList/LinkItem.tsx index 8939b450284..ee88f41d294 100644 --- a/packages/react/src/ActionList/LinkItem.tsx +++ b/packages/react/src/ActionList/LinkItem.tsx @@ -1,8 +1,10 @@ -import React from 'react' -import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic' +import type React from 'react' +import type {ForwardedRef} from 'react' +import type {WithSlotMarker} from '../utils/types/Slots' import Link from '../Link' import {Item} from './Item' import type {ActionListItemProps} from './shared' +import {type PolymorphicProps, fixedForwardRef} from '../utils/modern-polymorphic' // adopted from React.AnchorHTMLAttributes type LinkProps = { @@ -25,8 +27,13 @@ export type ActionListLinkItemProps = Pick< > & LinkProps -export const LinkItem = React.forwardRef( - ({active, inactiveText, variant, size, as: Component, className, ...props}, forwardedRef) => { +type LinkItemProps = PolymorphicProps + +const LinkItemComponent = fixedForwardRef( + ( + {active, inactiveText, variant, size, as: Component, className, ...props}: LinkItemProps, + forwardedRef: ForwardedRef, + ) => { return ( {children} ) : ( - + // eslint-disable-next-line @typescript-eslint/no-explicit-any + {children} ) @@ -53,8 +61,9 @@ export const LinkItem = React.forwardRef( ) }, -) as PolymorphicForwardRefComponent<'a', ActionListLinkItemProps> - -LinkItem.displayName = 'ActionList.LinkItem' +) -LinkItem.__SLOT__ = Symbol('ActionList.LinkItem') +export const LinkItem: WithSlotMarker = Object.assign(LinkItemComponent, { + displayName: 'ActionList.LinkItem', + __SLOT__: Symbol('ActionList.LinkItem'), +}) diff --git a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx index a42b45af0a9..cc830ce1619 100644 --- a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx @@ -11,6 +11,7 @@ import type {ResizeObserverEntry} from '../hooks/useResizeObserver' import {useOnEscapePress} from '../hooks/useOnEscapePress' import {useOnOutsideClick} from '../hooks/useOnOutsideClick' import {useFeatureFlag} from '../FeatureFlags' +import {type PolymorphicProps, fixedForwardRef} from '../utils/modern-polymorphic' export type BreadcrumbsProps = React.PropsWithChildren<{ /** @@ -360,41 +361,39 @@ const ItemSeparator = () => { ) } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -type DistributiveOmit = T extends any ? Omit : never - -type StyledBreadcrumbsItemProps = { - as?: As - to?: To - selected?: boolean - className?: string - style?: React.CSSProperties -} & DistributiveOmit, 'as'> - -function BreadcrumbsItemComponent( - props: StyledBreadcrumbsItemProps, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ref: ForwardedRef, -) { - const {as: Component = 'a', selected, className, ...rest} = props - return ( - - ) -} - -BreadcrumbsItemComponent.displayName = 'Breadcrumbs.Item' - -const BreadcrumbsItem = React.forwardRef(BreadcrumbsItemComponent) +type StyledBreadcrumbsItemProps = PolymorphicProps< + As, + 'a', + { + to?: To + selected?: boolean + } +> + +const BreadcrumbsItem = fixedForwardRef( + ( + props: StyledBreadcrumbsItemProps, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ref: ForwardedRef, + ) => { + const {as: Component = 'a', selected, className, ...rest} = props + return ( + + ) + }, +) Breadcrumbs.displayName = 'Breadcrumbs' export type BreadcrumbsItemProps = StyledBreadcrumbsItemProps -export default Object.assign(Breadcrumbs, {Item: BreadcrumbsItem}) + +const BreadcrumbsItemWithDisplayName = Object.assign(BreadcrumbsItem, {displayName: 'Breadcrumbs.Item'}) +export default Object.assign(Breadcrumbs, {Item: BreadcrumbsItemWithDisplayName}) /** * @deprecated Use the `Breadcrumbs` component instead (i.e. `` → ``) diff --git a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx index 54105c764de..f897bbfc239 100644 --- a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -5,6 +5,7 @@ import userEvent from '@testing-library/user-event' import {FeatureFlags} from '../../FeatureFlags' import {implementsClassName} from '../../utils/testing' import classes from '../Breadcrumbs.module.css' +import Link from '../../Link' // Helper function to render with theme and feature flags // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -548,4 +549,38 @@ describe('Breadcrumbs', () => { expect(container.firstChild).toHaveAttribute('data-variant', 'spacious') }) }) + + describe('as prop', () => { + it('supports polymorphic Breadcrumbs.Item with as prop', () => { + renderWithTheme( + + Home + + Docs + + , + {primer_react_breadcrumbs_overflow_menu: true}, + ) + + const homeItem = screen.getByText('Home') + const docsItem = screen.getByText('Docs') + + expect(homeItem.nodeName).toEqual('SPAN') + expect(docsItem.nodeName).toEqual('SPAN') + }) + + it('passes through additional props to the element specified by as', () => { + renderWithTheme( + + + Home + + , + {primer_react_breadcrumbs_overflow_menu: true}, + ) + + const homeLink = screen.getByTestId('home-link') + expect(homeLink).toHaveAttribute('href', '/home') + }) + }) }) diff --git a/packages/react/src/NavList/NavList.test.tsx b/packages/react/src/NavList/NavList.test.tsx index 81e79482cef..9495d0c77a3 100644 --- a/packages/react/src/NavList/NavList.test.tsx +++ b/packages/react/src/NavList/NavList.test.tsx @@ -4,6 +4,7 @@ import React from 'react' import {NavList} from './NavList' import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink' import {implementsClassName} from '../utils/testing' +import Link from '../Link' type NextJSLinkProps = {href: string; children: React.ReactNode} From 2da66024e332ac0510815aa304ecc13b6d07ea75 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Thu, 12 Mar 2026 20:13:17 +0000 Subject: [PATCH 2/8] fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item --- .changeset/curly-moments-show.md | 5 ++ .../react/src/ActionList/LinkItem.test.tsx | 85 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .changeset/curly-moments-show.md create mode 100644 packages/react/src/ActionList/LinkItem.test.tsx diff --git a/.changeset/curly-moments-show.md b/.changeset/curly-moments-show.md new file mode 100644 index 00000000000..d2ff82782b6 --- /dev/null +++ b/.changeset/curly-moments-show.md @@ -0,0 +1,5 @@ +--- +'@primer/react': minor +--- + +fix(polymorphic): Improve prop passthrough for ActionList.LinkItem and Breadcrumbs.Item diff --git a/packages/react/src/ActionList/LinkItem.test.tsx b/packages/react/src/ActionList/LinkItem.test.tsx new file mode 100644 index 00000000000..4aea7db13eb --- /dev/null +++ b/packages/react/src/ActionList/LinkItem.test.tsx @@ -0,0 +1,85 @@ +import {describe, it, expect, vi} from 'vitest' +import {render, screen, fireEvent} from '@testing-library/react' +import React from 'react' +import {ActionList} from '.' +import Link from '../Link' + +describe('ActionList.LinkItem', () => { + it('renders as an anchor by default', () => { + render( + + Home + , + ) + + const link = screen.getByRole('link', {name: 'Home'}) + expect(link).toHaveAttribute('href', '#home') + expect(link.tagName).toBe('A') + }) + + it('calls onClick handler', () => { + const onClick = vi.fn() + + render( + + + Home + + , + ) + + fireEvent.click(screen.getByRole('link', {name: 'Home'})) + expect(onClick).toHaveBeenCalledTimes(1) + }) + + describe('as prop', () => { + it('supports polymorphic LinkItem with as prop', () => { + const CustomLink = React.forwardRef>( + ({children, ...props}, ref) => ( + + {children} + + ), + ) + CustomLink.displayName = 'CustomLink' + + render( + + + Docs + + , + ) + + const link = screen.getByRole('link', {name: 'Docs'}) + expect(link).toHaveAttribute('data-custom-link') + expect(link).toHaveAttribute('href', '#docs') + }) + + it('passes through additional props to the element specified by as', () => { + render( + + + Home + + , + ) + + const homeLink = screen.getByTestId('home-link') + expect(homeLink).toHaveAttribute('href', '#home') + expect(homeLink).toHaveAttribute('data-inline', 'true') + }) + }) + + it('renders inactive text when inactiveText is provided', () => { + render( + + + Home + + , + ) + + expect(screen.getByText('Unavailable due to an outage')).toBeInTheDocument() + }) +}) From 50f4f0d00e61143db86974ee852c13a98b4ccf0e Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Thu, 12 Mar 2026 20:45:13 +0000 Subject: [PATCH 3/8] type fix --- packages/react/src/ActionList/LinkItem.tsx | 18 ++++++++++++------ packages/react/src/NavList/NavList.test.tsx | 1 - .../styled-react/src/components/ActionList.tsx | 4 +--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/react/src/ActionList/LinkItem.tsx b/packages/react/src/ActionList/LinkItem.tsx index ee88f41d294..e1687bbdc22 100644 --- a/packages/react/src/ActionList/LinkItem.tsx +++ b/packages/react/src/ActionList/LinkItem.tsx @@ -47,13 +47,19 @@ const LinkItemComponent = fixedForwardRef( onClick && onClick(event) props.onClick && props.onClick(event as React.MouseEvent) } - return inactiveText ? ( - {children} - ) : ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - + if (inactiveText) { + return {children} + } + + // Type safety for the polymorphic `as` prop is enforced at the + // LinkItem boundary via fixedForwardRef. Internally we widen + // Link's type so TypeScript doesn't re-check the generic + // constraint across two polymorphic layers. + const InternalLink: React.ElementType = Link + return ( + {children} - + ) }} > diff --git a/packages/react/src/NavList/NavList.test.tsx b/packages/react/src/NavList/NavList.test.tsx index 9495d0c77a3..81e79482cef 100644 --- a/packages/react/src/NavList/NavList.test.tsx +++ b/packages/react/src/NavList/NavList.test.tsx @@ -4,7 +4,6 @@ import React from 'react' import {NavList} from './NavList' import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink' import {implementsClassName} from '../utils/testing' -import Link from '../Link' type NextJSLinkProps = {href: string; children: React.ReactNode} diff --git a/packages/styled-react/src/components/ActionList.tsx b/packages/styled-react/src/components/ActionList.tsx index 44358b1c8e3..1fac8cf6d93 100644 --- a/packages/styled-react/src/components/ActionList.tsx +++ b/packages/styled-react/src/components/ActionList.tsx @@ -48,9 +48,7 @@ const ActionListImpl = React.forwardRef(function ActionListImpl }) -const StyledActionListLinkItem: ForwardRefComponent<'a', ActionListLinkItemProps> & SlotMarker = styled( - PrimerActionList.LinkItem, -).withConfig({ +const StyledActionListLinkItem = styled(PrimerActionList.LinkItem).withConfig({ shouldForwardProp: prop => prop !== 'sx', })` ${sx} From 02101afb275a4896fdbbfcc0e5ae83ce67f4dce3 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Thu, 12 Mar 2026 20:54:28 +0000 Subject: [PATCH 4/8] Add missing test --- packages/react/src/ActionList/LinkItem.test.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react/src/ActionList/LinkItem.test.tsx b/packages/react/src/ActionList/LinkItem.test.tsx index 4aea7db13eb..e711e0f3caf 100644 --- a/packages/react/src/ActionList/LinkItem.test.tsx +++ b/packages/react/src/ActionList/LinkItem.test.tsx @@ -3,8 +3,11 @@ import {render, screen, fireEvent} from '@testing-library/react' import React from 'react' import {ActionList} from '.' import Link from '../Link' +import {implementsClassName} from '../utils/testing' describe('ActionList.LinkItem', () => { + implementsClassName(ActionList.LinkItem) + it('renders as an anchor by default', () => { render( From 6967144415343d181986e331c29c660e9fef77d8 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Fri, 13 Mar 2026 16:51:44 +0000 Subject: [PATCH 5/8] Fix breadcrumbs overflow --- .../react/src/Breadcrumbs/Breadcrumbs.tsx | 11 ++++--- .../__tests__/Breadcrumbs.test.tsx | 30 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx index cc830ce1619..63ec6f09a08 100644 --- a/packages/react/src/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/react/src/Breadcrumbs/Breadcrumbs.tsx @@ -119,11 +119,14 @@ const BreadcrumbsMenuItem = React.forwardRef {items.map((item, index) => { - const href = item.props.href - const children = item.props.children - const selected = item.props.selected + const {children, selected, as: Component, ...itemProps} = item.props return ( - + {children} ) diff --git a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx index f897bbfc239..fe036d0ecd2 100644 --- a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -582,5 +582,35 @@ describe('Breadcrumbs', () => { const homeLink = screen.getByTestId('home-link') expect(homeLink).toHaveAttribute('href', '/home') }) + + it('passes through additional props to the element specified by as in overflow menu', async () => { + const user = userEvent.setup() + + renderWithTheme( + + + Home + + Docs + Components + Breadcrumbs + Examples + + Advanced + + , + {primer_react_breadcrumbs_overflow_menu: true}, + ) + + // Open the overflow menu + const menuButton = screen.getByRole('button', {name: /more breadcrumb items/i}) + await user.click(menuButton) + + // Verify the custom link in the overflow menu has the correct href + await waitFor(() => { + const homeLink = screen.getByTestId('home-link') + expect(homeLink).toHaveAttribute('href', '/home') + }) + }) }) }) From 7c38c07935b144b316bebd7b91f1dbdb65de4f05 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Fri, 13 Mar 2026 17:32:01 +0000 Subject: [PATCH 6/8] Fix NavList.item --- packages/react/src/NavList/NavList.test.tsx | 32 +++++++++++++++++ packages/react/src/NavList/NavList.tsx | 40 ++++++++++++++------- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/packages/react/src/NavList/NavList.test.tsx b/packages/react/src/NavList/NavList.test.tsx index 81e79482cef..52a0a6f4fe1 100644 --- a/packages/react/src/NavList/NavList.test.tsx +++ b/packages/react/src/NavList/NavList.test.tsx @@ -4,6 +4,7 @@ import React from 'react' import {NavList} from './NavList' import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink' import {implementsClassName} from '../utils/testing' +import Link from '../Link' type NextJSLinkProps = {href: string; children: React.ReactNode} @@ -458,4 +459,35 @@ describe('NavList.ShowMoreItem with pages', () => { expect(queryByRole('link', {name: 'Item 6'})).not.toBeInTheDocument() expect(queryByRole('link', {name: 'Item 7'})).not.toBeInTheDocument() }) + + it('passes through as props to the link items', () => { + const {queryByRole} = render( + + + Item 1 + + + Item 2 + + + , + ) + + act(() => { + queryByRole('button', {name: 'More'})?.click() + }) + + expect(queryByRole('link', {name: 'Item 1'})).toHaveAttribute('href', '#item1') + expect(queryByRole('link', {name: 'Item 1'})).toHaveAttribute('data-inline', 'true') + expect(queryByRole('link', {name: 'Item 2'})).toHaveAttribute('href', '#item2') + expect(queryByRole('link', {name: 'Item 2'})).toHaveAttribute('data-inline', 'true') + expect(queryByRole('link', {name: 'Item 3'})).toHaveAttribute('href', '#item3') + expect(queryByRole('link', {name: 'Item 4'})).toHaveAttribute('href', '#item4') + }) }) diff --git a/packages/react/src/NavList/NavList.tsx b/packages/react/src/NavList/NavList.tsx index c00ef3813e0..da86e67c98e 100644 --- a/packages/react/src/NavList/NavList.tsx +++ b/packages/react/src/NavList/NavList.tsx @@ -18,6 +18,7 @@ import classes from '../ActionList/ActionList.module.css' import navListClasses from './NavList.module.css' import {flushSync} from 'react-dom' import {isSlot} from '../utils/is-slot' +import {fixedForwardRef, type PolymorphicProps} from '../utils/modern-polymorphic' // ---------------------------------------------------------------------------- // NavList @@ -45,16 +46,23 @@ Root.displayName = 'NavList' // ---------------------------------------------------------------------------- // NavList.Item -export type NavListItemProps = { - children: React.ReactNode - defaultOpen?: boolean - href?: string - 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean - inactiveText?: string -} +export type NavListItemProps = PolymorphicProps< + As, + 'a', + { + children: React.ReactNode + defaultOpen?: boolean + href?: string + 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean + inactiveText?: string + } +> -const Item = React.forwardRef( - ({'aria-current': ariaCurrent, children, defaultOpen, ...props}, ref) => { +const ItemComponent = fixedForwardRef( + ( + {'aria-current': ariaCurrent, children, defaultOpen, as: Component, ...props}: NavListItemProps, + ref: React.ForwardedRef, + ) => { const {depth} = React.useContext(SubNavContext) // Get SubNav from children @@ -90,21 +98,27 @@ const Item = React.forwardRef( ) } + // Type safety for the polymorphic `as` prop is enforced at the + // Item boundary via fixedForwardRef. Internally we widen + // LinkItem's type so TypeScript doesn't re-check the generic + // constraint across two polymorphic layers. + const InternalLinkItem: React.ElementType = ActionList.LinkItem return ( - {children} - + ) }, -) as PolymorphicForwardRefComponent<'a', NavListItemProps> +) -Item.displayName = 'NavList.Item' +const Item = Object.assign(ItemComponent, {displayName: 'NavList.Item'}) // ---------------------------------------------------------------------------- // ItemWithSubNav (internal) From 7ba169234d92b5d37eba124d6499305a8d814a60 Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Fri, 13 Mar 2026 19:39:39 +0000 Subject: [PATCH 7/8] better tests --- .../react/src/ActionList/LinkItem.test.tsx | 19 ++++++++++--------- .../__tests__/Breadcrumbs.test.tsx | 1 + packages/react/src/NavList/NavList.test.tsx | 19 ++++++++++++++----- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/react/src/ActionList/LinkItem.test.tsx b/packages/react/src/ActionList/LinkItem.test.tsx index e711e0f3caf..f1b53f1d82b 100644 --- a/packages/react/src/ActionList/LinkItem.test.tsx +++ b/packages/react/src/ActionList/LinkItem.test.tsx @@ -37,25 +37,26 @@ describe('ActionList.LinkItem', () => { describe('as prop', () => { it('supports polymorphic LinkItem with as prop', () => { - const CustomLink = React.forwardRef>( - ({children, ...props}, ref) => ( - - {children} - - ), - ) + const CustomLink = React.forwardRef< + HTMLAnchorElement, + React.AnchorHTMLAttributes & {custom: boolean} + >(({children, custom, ...props}, ref) => ( + + {children} + + )) CustomLink.displayName = 'CustomLink' render( - + Docs , ) const link = screen.getByRole('link', {name: 'Docs'}) - expect(link).toHaveAttribute('data-custom-link') + expect(link).toHaveAttribute('data-custom-link', 'true') expect(link).toHaveAttribute('href', '#docs') }) diff --git a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx index fe036d0ecd2..12da8e2f932 100644 --- a/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx +++ b/packages/react/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx @@ -581,6 +581,7 @@ describe('Breadcrumbs', () => { const homeLink = screen.getByTestId('home-link') expect(homeLink).toHaveAttribute('href', '/home') + expect(homeLink).toHaveAttribute('data-inline', 'true') }) it('passes through additional props to the element specified by as in overflow menu', async () => { diff --git a/packages/react/src/NavList/NavList.test.tsx b/packages/react/src/NavList/NavList.test.tsx index 52a0a6f4fe1..b06da332b6e 100644 --- a/packages/react/src/NavList/NavList.test.tsx +++ b/packages/react/src/NavList/NavList.test.tsx @@ -4,7 +4,6 @@ import React from 'react' import {NavList} from './NavList' import {ReactRouterLikeLink} from '../Pagination/mocks/ReactRouterLink' import {implementsClassName} from '../utils/testing' -import Link from '../Link' type NextJSLinkProps = {href: string; children: React.ReactNode} @@ -461,12 +460,22 @@ describe('NavList.ShowMoreItem with pages', () => { }) it('passes through as props to the link items', () => { + const CustomLink = React.forwardRef< + HTMLAnchorElement, + React.AnchorHTMLAttributes & {custom: boolean} + >(({children, custom, ...props}, ref) => ( + + {children} + + )) + CustomLink.displayName = 'CustomLink' + const {queryByRole} = render( - + Item 1 - + Item 2 { }) expect(queryByRole('link', {name: 'Item 1'})).toHaveAttribute('href', '#item1') - expect(queryByRole('link', {name: 'Item 1'})).toHaveAttribute('data-inline', 'true') + expect(queryByRole('link', {name: 'Item 1'})).toHaveAttribute('data-custom-link', 'true') expect(queryByRole('link', {name: 'Item 2'})).toHaveAttribute('href', '#item2') - expect(queryByRole('link', {name: 'Item 2'})).toHaveAttribute('data-inline', 'true') + expect(queryByRole('link', {name: 'Item 2'})).toHaveAttribute('data-custom-link', 'false') expect(queryByRole('link', {name: 'Item 3'})).toHaveAttribute('href', '#item3') expect(queryByRole('link', {name: 'Item 4'})).toHaveAttribute('href', '#item4') }) From 5d1ff4e1b3d83c35970fe4e3e0449b61bd13143f Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Sat, 14 Mar 2026 05:39:09 +0900 Subject: [PATCH 8/8] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- packages/react/src/NavList/NavList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/NavList/NavList.tsx b/packages/react/src/NavList/NavList.tsx index da86e67c98e..f20b819bc82 100644 --- a/packages/react/src/NavList/NavList.tsx +++ b/packages/react/src/NavList/NavList.tsx @@ -46,7 +46,7 @@ Root.displayName = 'NavList' // ---------------------------------------------------------------------------- // NavList.Item -export type NavListItemProps = PolymorphicProps< +export type NavListItemProps = PolymorphicProps< As, 'a', {