From 8ae77eaa1bf42b43f1c99afb8e462bc6bc64dd4c Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Wed, 24 Apr 2024 10:21:21 -0500 Subject: [PATCH] Fixed off by 1 bug (#1935) --- packages/components/src/spectrum/utils/itemUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;