Skip to content

Commit da05622

Browse files
committed
Backport #5551 to this PR
1 parent 1ddf03e commit da05622

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react/src/SelectPanel/SelectPanel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ const getItemWithActiveDescendant = (
4242
const optionElements = listElement.querySelectorAll('[role="option"]')
4343

4444
const index = Array.from(optionElements).indexOf(activeItemElement)
45-
const activeItem = items[index]
45+
const activeItem = items[index] as ItemInput | undefined
4646

47-
const text = activeItem.text
48-
const selected = activeItem.selected
47+
const text = activeItem?.text
48+
const selected = activeItem?.selected
4949

5050
return {index, text, selected}
5151
}

0 commit comments

Comments
 (0)