Skip to content

The open alternative to Salesforce, designed for AI.

316 B
Raw Blame
export const measureItemWidths = ({
  items,
  itemElements,
}: {
  items: HTMLElement;
  itemElements: Element[];
}) => {
  items.setAttribute('data-measuring', '');
  const naturalItemWidths = itemElements.map((item) => item.clientWidth);
  items.removeAttribute('data-measuring');

  return naturalItemWidths;
};