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

Function getItems

examples/rsp-next-ts/components/ReorderableListView.tsx:18–27  ·  view source on GitHub ↗
(keys)

Source from the content-addressed store, hash-verified

16 // Append a generated key to the item type so they can only be reordered within this list and not dragged elsewhere.
17 let {dragAndDropHooks} = useDragAndDrop({
18 getItems(keys) {
19 return [...keys].map(key => {
20 let item = list.getItem(key);
21 // Setup the drag types and associated info for each dragged item.
22 return {
23 'custom-app-type-reorder': JSON.stringify(item),
24 'text/plain': item?.name ?? ''
25 };
26 });
27 },
28 acceptedDragTypes: ['custom-app-type-reorder'],
29 onReorder: async e => {
30 let {keys, target, dropOperation} = e;

Callers

nothing calls this directly

Calls 1

getItemMethod · 0.65

Tested by

no test coverage detected