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

Function onMove

packages/react-aria/src/table/useTableColumnResize.ts:190–206  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

188 startResize(item);
189 },
190 onMove(e) {
191 let {deltaX, deltaY, pointerType} = e;
192 if (direction === 'rtl') {
193 deltaX *= -1;
194 }
195 if (pointerType === 'keyboard') {
196 if (deltaY !== 0 && deltaX === 0) {
197 deltaX = deltaY * -1;
198 }
199 deltaX *= 10;
200 }
201 // if moving up/down only, no need to resize
202 if (deltaX !== 0) {
203 columnResizeWidthRef.current += deltaX;
204 resize(item, columnResizeWidthRef.current);
205 }
206 },
207 onMoveEnd(e) {
208 let {pointerType} = e;
209 columnResizeWidthRef.current = 0;

Callers

nothing calls this directly

Calls 1

resizeFunction · 0.50

Tested by

no test coverage detected