UNPKG

react-dnd-accessible-backend

Version:

An add-on backend for react-dnd that provides support for keyboards and screenreaders by default.

10 lines 364 B
export default function getNodeClientOffset(node) { if (node == null) return { x: 0, y: 0 }; const el = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement; if (!el) return { x: 0, y: 0 }; const { top, left } = el.getBoundingClientRect(); return { x: left, y: top }; } //# sourceMappingURL=getNodeClientOffset.js.map