MCPcopy Create free account
hub / github.com/adobe/react-spectrum / resizeCol

Function resizeCol

packages/react-aria-components/test/Table.test.js:2398–2411  ·  view source on GitHub ↗
(tree, col, delta)

Source from the content-addressed store, hash-verified

2396 }
2397
2398 function resizeCol(tree, col, delta) {
2399 act(() => {
2400 setInteractionModality('pointer');
2401 });
2402 let column = getColumn(tree, col);
2403 let resizer = within(column).getByRole('slider');
2404
2405 fireEvent.pointerEnter(resizer);
2406
2407 // actual locations do not matter, the delta matters between events for the calculation of useMove
2408 fireEvent.pointerDown(resizer, {pointerType: 'mouse', pointerId: 1, pageX: 0, pageY: 30});
2409 fireEvent.pointerMove(resizer, {pointerType: 'mouse', pointerId: 1, pageX: delta, pageY: 25});
2410 fireEvent.pointerUp(resizer, {pointerType: 'mouse', pointerId: 1});
2411 }
2412
2413 function resizeTable(clientWidth, newValue) {
2414 clientWidth.mockImplementation(() => newValue);

Callers

nothing calls this directly

Calls 3

setInteractionModalityFunction · 0.90
actFunction · 0.85
getColumnFunction · 0.70

Tested by

no test coverage detected