refactor(ui): simplify measurement hook in BaseSelectionList

This commit is contained in:
Mark McLaughlin
2026-03-06 16:09:33 -08:00
parent 213cdccb6c
commit cb9cc88478

View File

@@ -96,11 +96,9 @@ export function BaseSelectionList<
// We want to track the "true" offset relative to the viewport.
// Since we apply -breakoutAmount as a margin to the SELECTED item,
// it should not affect the parent container's x coordinate in a standard layout.
if (x !== horizontalOffset) {
setHorizontalOffset(x);
}
setHorizontalOffset(x);
}
}, [terminalWidth, mainAreaWidth, horizontalOffset]);
}, [terminalWidth, mainAreaWidth]);
// Handle scrolling for long lists
useEffect(() => {