@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
25 lines (23 loc) • 741 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getElementByDraggableLocation = getElementByDraggableLocation;
var _attributes = require("./attributes");
var _findElement = require("./find-element");
// eslint-disable-next-line import/no-extraneous-dependencies
function getElementByDraggableLocation(contextId, location) {
if (!location) {
return null;
}
return (0, _findElement.findElement)({
attribute: _attributes.attributes.draggable.contextId,
value: contextId
}, {
attribute: _attributes.customAttributes.draggable.droppableId,
value: location.droppableId
}, {
attribute: _attributes.customAttributes.draggable.index,
value: String(location.index)
});
}