diff --git a/web/app/components/datasets/documents/detail/completed/common/__tests__/summary-text.spec.tsx b/web/app/components/datasets/documents/detail/completed/common/__tests__/summary-text.spec.tsx
index 1e470aa0d51..53334369674 100644
--- a/web/app/components/datasets/documents/detail/completed/common/__tests__/summary-text.spec.tsx
+++ b/web/app/components/datasets/documents/detail/completed/common/__tests__/summary-text.spec.tsx
@@ -26,6 +26,11 @@ describe('SummaryText', () => {
expect(screen.getByTestId('textarea')).toHaveValue('My summary')
})
+ it('should cap the auto-growing summary field', () => {
+ render()
+ expect(screen.getByTestId('textarea')).toHaveAttribute('maxRows', '6')
+ })
+
it('should render empty string when value is undefined', () => {
render()
expect(screen.getByTestId('textarea')).toHaveValue('')
diff --git a/web/app/components/datasets/documents/detail/completed/common/summary-text.tsx b/web/app/components/datasets/documents/detail/completed/common/summary-text.tsx
index 374f45d773e..23fc02e3945 100644
--- a/web/app/components/datasets/documents/detail/completed/common/summary-text.tsx
+++ b/web/app/components/datasets/documents/detail/completed/common/summary-text.tsx
@@ -22,6 +22,7 @@ const SummaryText = ({ value, onChange, disabled }: SummaryTextProps) => {
)}
placeholder={t(($) => $['segment.summaryPlaceholder'], { ns: 'datasetDocuments' })}
minRows={1}
+ maxRows={6}
value={value ?? ''}
onChange={(e) => onChange?.(e.target.value)}
disabled={disabled}