fix: clamp connection rowIndex to list size

This commit is contained in:
Sylvia Crowe
2024-09-09 17:06:48 -07:00
parent 01d98fccd2
commit 639e796296
+3
View File
@@ -680,6 +680,9 @@ const ChangeConnectionBlockModal = React.memo(
},
[changeConnModalAtom, viewModel, blockId, connSelected, selectionList]
);
React.useEffect(() => {
setRowIndex((idx) => Math.min(idx, filteredList.length));
}, [selectionList, setRowIndex]);
// this check was also moved to BlockFrame to prevent all the above code from running unnecessarily
if (!changeConnModalOpen) {
return null;