react-beautiful-dnd
Version:
Beautiful, accessible drag and drop for lists with React.js
34 lines (26 loc) • 791 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var isScrollable = function isScrollable() {
for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
return values.some(function (value) {
return value === 'auto' || value === 'scroll';
});
};
var isElementScrollable = function isElementScrollable(el) {
var style = window.getComputedStyle(el);
return isScrollable(style.overflow, style.overflowY, style.overflowX);
};
var getClosestScrollable = function getClosestScrollable(el) {
if (el == null) {
return null;
}
if (!isElementScrollable(el)) {
return getClosestScrollable(el.parentElement);
}
return el;
};
exports.default = getClosestScrollable;