diff --git a/src/NavList/NavList.stories.tsx b/src/NavList/NavList.stories.tsx index 4e1b472570c..f643302c1f8 100644 --- a/src/NavList/NavList.stories.tsx +++ b/src/NavList/NavList.stories.tsx @@ -28,13 +28,18 @@ export const Simple: Story = () => ( export const WithGroup: Story = () => ( - + Item 1 Item 2 Item 3 + + Item 4 + Item 5 + Item 6 + ) diff --git a/src/NavList/NavList.tsx b/src/NavList/NavList.tsx index 077b46d96ad..80550abc989 100644 --- a/src/NavList/NavList.tsx +++ b/src/NavList/NavList.tsx @@ -246,14 +246,16 @@ const defaultSx = {} // TODO: ref prop const Group: React.FC = ({title, children, sx: sxProp = defaultSx, ...props}) => { return ( - + <> {/* Hide divider if the group is the first item in the list */} - - {title && } - - {children} + + + {title && } + + {children} + - + > ) } diff --git a/src/NavList/__snapshots__/NavList.test.tsx.snap b/src/NavList/__snapshots__/NavList.test.tsx.snap index 0bf63a4a99d..443240545e4 100644 --- a/src/NavList/__snapshots__/NavList.test.tsx.snap +++ b/src/NavList/__snapshots__/NavList.test.tsx.snap @@ -407,7 +407,7 @@ exports[`NavList renders with groups 1`] = ` list-style: none; } -.c2:first-child { +.c2:first-of-type { display: none; } @@ -701,15 +701,15 @@ exports[`NavList renders with groups 1`] = ` + - @@ -748,15 +748,15 @@ exports[`NavList renders with groups 1`] = ` + -