@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration
Version:
An optional Pragmatic drag and drop package that enables rapid migration from react-beautiful-dnd to Pragmatic drag and drop
19 lines (18 loc) • 561 B
JavaScript
// eslint-disable-next-line import/no-extraneous-dependencies
import { attributes, customAttributes } from './attributes';
import { findElement } from './find-element';
export function getElementByDraggableLocation(contextId, location) {
if (!location) {
return null;
}
return findElement({
attribute: attributes.draggable.contextId,
value: contextId
}, {
attribute: customAttributes.draggable.droppableId,
value: location.droppableId
}, {
attribute: customAttributes.draggable.index,
value: String(location.index)
});
}