export const stretch = ( element: HTMLElement, containerElement?: HTMLElement ) => { // Make sure the element exists if (!element) { return; } let containingElement = containerElement || null; if (!containerElement) { // If no container element was specified, use its parent. If there is no parent use containingElement = element.parentElement || document.body; } // A containg element must be present as well if (!containingElement) { return; } element.style.height = `${containingElement.getBoundingClientRect().height - element.offsetTop}px`; }; /** * Use as the `type` field on the element */ export enum UIReflowEventType { StretchCardElements = "stretch_card_elements", }