diff --git a/src/components/organisms/teacher/OakUnitListItem/OakUnitListItem.tsx b/src/components/organisms/teacher/OakUnitListItem/OakUnitListItem.tsx index d82ba825..45fd928d 100644 --- a/src/components/organisms/teacher/OakUnitListItem/OakUnitListItem.tsx +++ b/src/components/organisms/teacher/OakUnitListItem/OakUnitListItem.tsx @@ -1,4 +1,8 @@ -import React, { ComponentPropsWithoutRef, ElementType } from "react"; +import React, { + ComponentPropsWithoutRef, + ElementType, + MutableRefObject, +} from "react"; import styled, { css } from "styled-components"; import { OakFlex, OakBox, OakP, OakHeading, OakSpan } from "@/components/atoms"; @@ -80,6 +84,7 @@ export type OakUnitListItemProps = { lessonCount: number | null; isLegacy: boolean; href: string; + firstItemRef?: MutableRefObject | null | undefined; } & ComponentPropsWithoutRef; /** @@ -100,6 +105,7 @@ export const OakUnitListItem = ( onClick, index, isLegacy, + firstItemRef, ...rest } = props; @@ -115,6 +121,7 @@ export const OakUnitListItem = ( $disabled={disabledOrUnavailable} href={disabledOrUnavailable ? undefined : href} onClick={disabledOrUnavailable ? undefined : onClick} + ref={firstItemRef} {...rest} >