diff --git a/tests/perf-test/SelectionList.perf-test.tsx b/tests/perf-test/SelectionList.perf-test.tsx index c2e3e4383c45..2a9791ec714d 100644 --- a/tests/perf-test/SelectionList.perf-test.tsx +++ b/tests/perf-test/SelectionList.perf-test.tsx @@ -79,14 +79,18 @@ function SelectionListWrapper({canSelectMultiple}: SelectionListWrapperProps) { ]; const onSelectRow = (item: ListItem) => { + if (!item.keyForList) { + return; + } + if (canSelectMultiple) { - if (selectedIds.includes(item.keyForList as string)) { + if (selectedIds.includes(item.keyForList)) { setSelectedIds(selectedIds.filter((selectedId) => selectedId === item.keyForList)); } else { - setSelectedIds([...selectedIds, (item.keyForList as string)]); + setSelectedIds([...selectedIds, item.keyForList]); } } else { - setSelectedIds([(item.keyForList as string)]); + setSelectedIds([item.keyForList]); } };