MCPcopy Index your code
hub / github.com/adobe/react-spectrum / useVirtualDrop

Function useVirtualDrop

packages/react-aria/src/dnd/useVirtualDrop.ts:31–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29};
30
31export function useVirtualDrop(): VirtualDropResult {
32 let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/dnd');
33 let modality = useDragModality();
34 let dragSession = DragManager.useDragSession();
35 let descriptionProps = useDescription(
36 dragSession ? stringFormatter.format(MESSAGES[modality]) : ''
37 );
38
39 return {
40 dropProps: {
41 ...descriptionProps,
42 // Mobile Safari does not properly bubble click events on elements except links or inputs
43 // unless there is an onclick handler bound directly to the element itself. By adding this
44 // handler, React will take care of adding that for us, and we are able to handle document
45 // level click events in the DragManager.
46 // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
47 onClick: () => {}
48 }
49 };
50}

Callers 2

useDropFunction · 0.90
useDroppableItemFunction · 0.90

Calls 4

useDragModalityFunction · 0.90
useDescriptionFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected