@uifabric/utilities
Version:
Fluent UI React utilities for building components.
31 lines • 918 B
JavaScript
/**
* Detects whether an element's content has horizontal overflow
*
* @public
* @param element - Element to check for overflow
* @returns True if element's content overflows
*/
export function hasHorizontalOverflow(element) {
return element.clientWidth < element.scrollWidth;
}
/**
* Detects whether an element's content has vertical overflow
*
* @public
* @param element - Element to check for overflow
* @returns True if element's content overflows
*/
export function hasVerticalOverflow(element) {
return element.clientHeight < element.scrollHeight;
}
/**
* 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
*/
export function hasOverflow(element) {
return hasHorizontalOverflow(element) || hasVerticalOverflow(element);
}
//# sourceMappingURL=overflow.js.map