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

Function onChange

packages/react-aria/src/table/useTableColumnResize.ts:285–295  ·  view source on GitHub ↗
(e: ChangeEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

283 }, [resizingColumn, item, focusInput, ref]);
284
285 let onChange = (e: ChangeEvent<HTMLInputElement>) => {
286 let currentWidth = state.getColumnWidth(item.key);
287 let nextValue = parseFloat(getEventTarget(e).value);
288
289 if (nextValue > currentWidth) {
290 nextValue = currentWidth + 10;
291 } else {
292 nextValue = currentWidth - 10;
293 }
294 resize(item, nextValue);
295 };
296
297 let {pressProps} = usePress({
298 preventFocusOnPress: true,

Callers

nothing calls this directly

Calls 3

getEventTargetFunction · 0.90
getColumnWidthMethod · 0.80
resizeFunction · 0.50

Tested by

no test coverage detected