@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) • 537 B
JavaScript
import { attributes } from './attributes';
import { findElement } from './find-element';
/**
* Obtains the `HTMLElement` with the data attribute passed down through
* `provided.dragHandleProps`
*/
export function findDragHandle(_ref) {
var contextId = _ref.contextId,
draggableId = _ref.draggableId;
// Otherwise the drag handle is a descendant.
return findElement({
attribute: attributes.dragHandle.contextId,
value: contextId
}, {
attribute: attributes.dragHandle.draggableId,
value: draggableId
});
}