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

Function RootDropIndicator

packages/react-aria-components/src/GridList.tsx:793–818  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

791const GridListDropIndicatorForwardRef = forwardRef(GridListDropIndicator);
792
793function RootDropIndicator() {
794 let {dragAndDropHooks, dropState} = useContext(DragAndDropContext);
795 let ref = useRef<HTMLDivElement>(null);
796 // oxlint-disable-next-line react/react-compiler
797 let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!(
798 {
799 target: {type: 'root'}
800 },
801 dropState!,
802 ref
803 );
804 let isDropTarget = dropState!.isDropTarget({type: 'root'});
805 let {visuallyHiddenProps} = useVisuallyHidden();
806
807 if (!isDropTarget && dropIndicatorProps['aria-hidden']) {
808 return null;
809 }
810
811 return (
812 <div role="row" aria-hidden={dropIndicatorProps['aria-hidden']} style={{position: 'absolute'}}>
813 <div role="gridcell">
814 <div role="button" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />
815 </div>
816 </div>
817 );
818}
819
820export interface GridListLoadMoreItemProps
821 extends

Callers

nothing calls this directly

Calls 2

useVisuallyHiddenFunction · 0.90
isDropTargetMethod · 0.80

Tested by

no test coverage detected