Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(conversations): fix input height (#117623)

Alex Vfea2336b6582
diff --git a/products/conversations/frontend/components/Editor/SupportEditor.scss b/products/conversations/frontend/components/Editor/SupportEditor.scss
index bafc33abdbfd..ce735d5d1785 100644
--- a/products/conversations/frontend/components/Editor/SupportEditor.scss
+++ b/products/conversations/frontend/components/Editor/SupportEditor.scss
@@ -155,6 +155,12 @@
content: attr(data-placeholder);
}
}
+
+ // Cap the text area, not the editor frame, so the formatting toolbar stays put.
+ &--scroll {
+ max-height: var(--support-editor-max-height);
+ overflow-y: auto;
+ }
}
&__image {
diff --git a/products/conversations/frontend/components/Editor/SupportEditor.tsx b/products/conversations/frontend/components/Editor/SupportEditor.tsx
index d4859a632dec..f9a904cbc5fc 100644
--- a/products/conversations/frontend/components/Editor/SupportEditor.tsx
+++ b/products/conversations/frontend/components/Editor/SupportEditor.tsx
@@ -19,7 +19,7 @@ import StarterKit from '@tiptap/starter-kit'
import { useActions, useValues } from 'kea'
import { common, createLowlight } from 'lowlight'
import posthog from 'posthog-js'
-import { useCallback, useEffect, useRef, useState } from 'react'
+import { useCallback, useEffect, useRef, useState, type CSSProperties } from 'react'
import { IconCode, IconCopy, IconImage, IconList, IconTerminal } from '@posthog/icons'
@@ -157,6 +157,8 @@ export type SupportEditorProps = {
onUploadingChange?: (uploading: boolean) => void
disabled?: boolean
minRows?: number
+ /** Past this, the text scrolls so the toolbar and send bar stay on screen. */
+ maxRows?: number
className?: string
autoFocus?: boolean
/** Rendered inside the editor's frame, above the text */
@@ -479,6 +481,7 @@ export function SupportEditor({
onUploadingChange,
disabled = false,
minRows,
+ maxRows = 12,
className,
autoFocus = false,
header,
@@ -628,9 +631,14 @@ export function SupportEditor({
{header}
<EditorContent
editor={editor}
- className="SupportEditor__content p-2"
+ className={cn('SupportEditor__content p-2', maxRows && 'SupportEditor__content--scroll')}
autoFocus={autoFocus}
- style={minRows ? { minHeight: `${minRows * 1.5}em` } : undefined}
+ style={
+ {
+ ...(minRows ? { minHeight: `${minRows * 1.5}em` } : {}),
+ ...(maxRows ? { '--support-editor-max-height': `${maxRows * 1.5}em` } : {}),
+ } as CSSProperties
+ }
/>
<div className="flex justify-between p-0.5">
<div className="flex items-center">