@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
16 lines • 523 B
JavaScript
/**
* Ported from `react-beautiful-dnd`
*/
export 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);
}