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

Function resizeCol

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

Source from the content-addressed store, hash-verified

2094 }
2095
2096 function resizeCol(tree, col, delta) {
2097 act(() => {
2098 setInteractionModality('pointer');
2099 });
2100 let column = getColumn(tree, col);
2101 let resizer = within(column).getByRole('slider');
2102
2103 fireEvent.pointerEnter(resizer);
2104
2105 // actual locations do not matter, the delta matters between events for the calculation of useMove
2106 fireEvent.pointerDown(resizer, {pointerType: 'mouse', pointerId: 1, pageX: 0, pageY: 30});
2107 fireEvent.pointerMove(resizer, {pointerType: 'mouse', pointerId: 1, pageX: delta, pageY: 25});
2108 fireEvent.pointerUp(resizer, {pointerType: 'mouse', pointerId: 1});
2109 }
2110
2111 function resizeTable(clientWidth, newValue) {
2112 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