Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getItemMaxHeight(): number {
let itemMaxHeight: number = 0;
const children: HTMLElement = get(
this.horizontalOverflowItemsRef,
"current.childNodes"
);
if (!canUseDOM() || !children) {
return itemMaxHeight;
}
const childNodes: HTMLElement[] = Array.prototype.slice.call(children);
for (const childNode of childNodes) {
const childNodeHeight: number = getClientRectWithMargin(childNode).height;
if (childNodeHeight > itemMaxHeight) {
itemMaxHeight = childNodeHeight;
}
}
return itemMaxHeight;
}
private getAvailableWidth(): number {
return getClientRectWithMargin(this.horizontalOverflowItemsRef.current).width;
}
private getItemWidths(): number[] {
const items: HTMLElement[] = Array.prototype.slice.call(
this.horizontalOverflowItemsRef.current.childNodes
);
const itemWidths: number[] = [];
for (const item of items) {
itemWidths.push(getClientRectWithMargin(item).width);
}
return itemWidths;
}