fix: in variable settings, use Textarea to replace Input. (#17864)

This commit is contained in:
Good Wood 2025-04-11 15:24:16 +08:00 committed by GitHub
parent b2f5ca356a
commit fe19cc7568
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 8 deletions

View File

@ -322,9 +322,11 @@ const ChatVariableModal = ({
</div> </div>
<div className='flex'> <div className='flex'>
{type === ChatVarType.String && ( {type === ChatVarType.String && (
<Input // Input will remove \n\r, so use Textarea just like description area
placeholder={t('workflow.chatVariable.modal.valuePlaceholder') || ''} <textarea
className='system-sm-regular placeholder:system-sm-regular block h-20 w-full resize-none appearance-none rounded-lg border border-transparent bg-components-input-bg-normal p-2 caret-primary-600 outline-none placeholder:text-components-input-text-placeholder hover:border-components-input-border-hover hover:bg-components-input-bg-hover focus:border-components-input-border-active focus:bg-components-input-bg-active focus:shadow-xs'
value={value} value={value}
placeholder={t('workflow.chatVariable.modal.valuePlaceholder') || ''}
onChange={e => setValue(e.target.value)} onChange={e => setValue(e.target.value)}
/> />
)} )}

View File

@ -131,12 +131,20 @@ const VariableModal = ({
<div className=''> <div className=''>
<div className='system-sm-semibold mb-1 flex h-6 items-center text-text-secondary'>{t('workflow.env.modal.value')}</div> <div className='system-sm-semibold mb-1 flex h-6 items-center text-text-secondary'>{t('workflow.env.modal.value')}</div>
<div className='flex'> <div className='flex'>
<Input {
type !== 'number' ? <textarea
className='system-sm-regular placeholder:system-sm-regular block h-20 w-full resize-none appearance-none rounded-lg border border-transparent bg-components-input-bg-normal p-2 caret-primary-600 outline-none placeholder:text-components-input-text-placeholder hover:border-components-input-border-hover hover:bg-components-input-bg-hover focus:border-components-input-border-active focus:bg-components-input-bg-active focus:shadow-xs'
value={value}
placeholder={t('workflow.env.modal.valuePlaceholder') || ''}
onChange={e => setValue(e.target.value)}
/>
: <Input
placeholder={t('workflow.env.modal.valuePlaceholder') || ''} placeholder={t('workflow.env.modal.valuePlaceholder') || ''}
value={value} value={value}
onChange={e => setValue(e.target.value)} onChange={e => setValue(e.target.value)}
type={type !== 'number' ? 'text' : 'number'} type="number"
/> />
}
</div> </div>
</div> </div>
</div> </div>