UNPKG

@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

22 lines (21 loc) 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findClosestScrollContainer = findClosestScrollContainer; /** * Ported from `react-beautiful-dnd` */ function findClosestScrollContainer(element) { var _getComputedStyle = getComputedStyle(element), overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; if (overflowX === 'scroll' || overflowX === 'auto' || overflowY === 'scroll' || overflowY === 'auto') { return element; } var parentElement = element.parentElement; if (parentElement === null) { return null; } return findClosestScrollContainer(parentElement); }