MCPcopy Index your code
hub / github.com/Comcast/react-data-grid / scrollGrid

Function scrollGrid

test/browser/utils.tsx:107–127  ·  view source on GitHub ↗
({
  scrollLeft,
  scrollTop
}: {
  scrollLeft?: number;
  scrollTop?: number;
})

Source from the content-addressed store, hash-verified

105}
106
107export async function scrollGrid({
108 scrollLeft,
109 scrollTop
110}: {
111 scrollLeft?: number;
112 scrollTop?: number;
113}) {
114 const grid = getGrid().element();
115
116 if (scrollLeft !== undefined) {
117 grid.scrollLeft = scrollLeft;
118 }
119 if (scrollTop !== undefined) {
120 grid.scrollTop = scrollTop;
121 }
122
123 if (scrollLeft !== undefined || scrollTop !== undefined) {
124 // let the browser fire the 'scroll' event
125 await new Promise(requestAnimationFrame);
126 }
127}
128
129export async function tabIntoGrid() {
130 await userEvent.click(page.getByRole('button', { name: 'Before' }));

Callers 1

Calls 1

getGridFunction · 0.85

Tested by

no test coverage detected