Skip to content

Commit bd61faf

Browse files
authored
fix: console code error (#956)
1 parent 0e48f4f commit bd61faf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/Search/DropdownList.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ function DropdownList({
173173
)}
174174

175175
{items.map((hit) => {
176-
const currentIndex = hit.document.index || 0;
176+
const currentIndex = hit.document.index ?? 0;
177+
const itemKey = `${sourceName}-${hit.document.id ?? currentIndex}`;
177178

178179
return (
179180
<DropdownListItem
180-
key={hit.document.id}
181+
key={itemKey}
181182
item={hit.document}
182183
selectedIndex={selectedIndex}
183184
currentIndex={currentIndex}

0 commit comments

Comments
 (0)