()
| 29 | }; |
| 30 | |
| 31 | export 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 | } |
no test coverage detected