diff --git a/packages/components/src/spectrum/utils/itemUtils.ts b/packages/components/src/spectrum/utils/itemUtils.ts index e293b46a67..a103ea03fe 100644 --- a/packages/components/src/spectrum/utils/itemUtils.ts +++ b/packages/components/src/spectrum/utils/itemUtils.ts @@ -132,7 +132,7 @@ export async function getPositionOfSelectedItemElement< return position; } - for (let i = 0; i <= items.length; i += 1) { + for (let i = 0; i < items.length; i += 1) { const item = items[i]; if (item.key === selectedKey) { return position;