@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 • 450 B
JavaScript
/**
* Ported from `react-beautiful-dnd`
*/
export function findClosestScrollContainer(element) {
const {
overflowX,
overflowY
} = getComputedStyle(element);
if (overflowX === 'scroll' || overflowX === 'auto' || overflowY === 'scroll' || overflowY === 'auto') {
return element;
}
const {
parentElement
} = element;
if (parentElement === null) {
return null;
}
return findClosestScrollContainer(parentElement);
}