mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 19:38:30 +08:00
fix(web): bound segment summary editor height
This commit is contained in:
parent
211344d0b0
commit
b02b64dcb8
@ -26,6 +26,11 @@ describe('SummaryText', () => {
|
||||
expect(screen.getByTestId('textarea')).toHaveValue('My summary')
|
||||
})
|
||||
|
||||
it('should cap the auto-growing summary field', () => {
|
||||
render(<SummaryText />)
|
||||
expect(screen.getByTestId('textarea')).toHaveAttribute('maxRows', '6')
|
||||
})
|
||||
|
||||
it('should render empty string when value is undefined', () => {
|
||||
render(<SummaryText onChange={onChange} />)
|
||||
expect(screen.getByTestId('textarea')).toHaveValue('')
|
||||
|
||||
@ -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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user