@uifabric/utilities
Version:
Fluent UI React utilities for building components.
36 lines • 1.11 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Detects whether an element's content has horizontal overflow
*
* @public
* @param element - Element to check for overflow
* @returns True if element's content overflows
*/
function hasHorizontalOverflow(element) {
return element.clientWidth < element.scrollWidth;
}
exports.hasHorizontalOverflow = hasHorizontalOverflow;
/**
* Detects whether an element's content has vertical overflow
*
* @public
* @param element - Element to check for overflow
* @returns True if element's content overflows
*/
function hasVerticalOverflow(element) {
return element.clientHeight < element.scrollHeight;
}
exports.hasVerticalOverflow = hasVerticalOverflow;
/**
* Detects whether an element's content has overflow in any direction
*
* @public
* @param element - Element to check for overflow
* @returns True if element's content overflows
*/
function hasOverflow(element) {
return hasHorizontalOverflow(element) || hasVerticalOverflow(element);
}
exports.hasOverflow = hasOverflow;
//# sourceMappingURL=overflow.js.map
;