Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

429 B
Raw Blame
const DEFAULT_TEXTAREA_MAX_HEIGHT = 160;

export const adjustTextareaHeight = (
  textarea: HTMLTextAreaElement | null,
  maxHeight: number = DEFAULT_TEXTAREA_MAX_HEIGHT,
): void => {
  if (!textarea) return;

  textarea.style.height = 'auto';
  const newHeight = Math.min(textarea.scrollHeight, maxHeight);
  textarea.style.height = `${newHeight}px`;
  textarea.style.overflowY = newHeight === maxHeight ? 'auto' : 'hidden';
};