SelectMenu: Fix potential undefined problem (#87835)
This commit is contained in:
@@ -57,7 +57,7 @@ export const VirtualizedSelectMenu = ({
|
||||
const styles = getSelectStyles(theme);
|
||||
const listRef = useRef<List>(null);
|
||||
|
||||
const focusedIndex = options.findIndex((option: SelectableValue<unknown>) => option.value === focusedOption.value);
|
||||
const focusedIndex = options.findIndex((option: SelectableValue<unknown>) => option.value === focusedOption?.value);
|
||||
|
||||
useEffect(() => {
|
||||
listRef.current?.scrollToItem(focusedIndex);
|
||||
|
||||
Reference in New Issue
Block a user