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

Function RootDropIndicator

packages/react-aria-components/src/Table.tsx:2301–2333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2299const TableDropIndicatorForwardRef = forwardRef(TableDropIndicator);
2300
2301function RootDropIndicator() {
2302 let state = useContext(TableStateContext)!;
2303 let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);
2304 let ref = useRef<HTMLDivElement>(null);
2305 // oxlint-disable-next-line react/react-compiler
2306 let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!(
2307 {
2308 target: {type: 'root'}
2309 },
2310 dropState!,
2311 ref
2312 );
2313 let isDropTarget = dropState!.isDropTarget({type: 'root'});
2314 let {visuallyHiddenProps} = useVisuallyHidden();
2315
2316 if (!isDropTarget && dropIndicatorProps['aria-hidden']) {
2317 return null;
2318 }
2319
2320 return (
2321 <TableRowElementType
2322 role="row"
2323 aria-hidden={dropIndicatorProps['aria-hidden']}
2324 style={{height: 0}}>
2325 <TableCellElementType
2326 role="gridcell"
2327 colSpan={state.collection.columnCount}
2328 style={{padding: 0}}>
2329 <div role="button" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />
2330 </TableCellElementType>
2331 </TableRowElementType>
2332 );
2333}
2334
2335export interface TableLoadMoreItemProps
2336 extends

Callers

nothing calls this directly

Calls 2

useVisuallyHiddenFunction · 0.90
isDropTargetMethod · 0.80

Tested by

no test coverage detected