diff --git a/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx b/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx index 475c9abb9..b53002907 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ContentList.tsx @@ -111,8 +111,12 @@ const ContentList: FunctionComponent = ({ tabIndex={FOCUSABLE_BUT_NOT_TABBABLE} > {items.map((item, index) => { - const previousItem = items[index - 1] - const nextItem = items[index + 1] + const previousIndex = index - 1 + const previousItem = previousIndex >= 0 ? items[previousIndex] : undefined + + const nextIndex = index + 1 + const nextItem = nextIndex < items.length ? items[nextIndex] : undefined + return (