MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / scrollToCell

Function scrollToCell

lib/components/MultiGrid/MultiGrid.tsx:213–232  ·  view source on GitHub ↗
({ align, columnIndex, rowIndex })

Source from the content-addressed store, hash-verified

211 },
212
213 scrollToCell({ align, columnIndex, rowIndex }) {
214 const { fixedColumnCount, fixedRowCount } = internals.latest;
215
216 // Fixed cells are always visible (in the corresponding axis)
217 const adjustedColumnIndex =
218 columnIndex !== undefined && columnIndex >= fixedColumnCount
219 ? columnIndex - fixedColumnCount
220 : undefined;
221 const adjustedRowIndex =
222 rowIndex !== undefined && rowIndex >= fixedRowCount
223 ? rowIndex - fixedRowCount
224 : undefined;
225
226 // The other quadrants are synced when the bottom-right Grid reports its new offsets (via onScroll)
227 internals.bottomRightGrid?.scrollToCell({
228 align,
229 columnIndex: adjustedColumnIndex,
230 rowIndex: adjustedRowIndex
231 });
232 },
233
234 scrollToPosition({ scrollLeft, scrollTop }) {
235 internals.bottomRightGrid?.scrollToPosition({ scrollLeft, scrollTop });

Callers

nothing calls this directly

Calls 1

scrollToCellMethod · 0.65

Tested by

no test coverage detected