Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: event of keyboard "enter" in text generator app (#3823)

KVOJJJin1a7b4c42abbf
diff --git a/web/app/components/base/tag-management/selector.tsx b/web/app/components/base/tag-management/selector.tsx
index 9de25a34f0b..706720543d0 100644
--- a/web/app/components/base/tag-management/selector.tsx
+++ b/web/app/components/base/tag-management/selector.tsx
@@ -232,7 +232,6 @@ const TagSelector: FC<TagSelectorProps> = ({
<div className='grow text-xs text-start leading-[18px] font-normal truncate'>
{!triggerContent ? t('common.tag.addTag') : triggerContent}
</div>
- <span className='hidden absolute top-[-21px] left-[50%] translate-x-[-50%] px-2 py-[3px] border-[0.5px] border-black/5 rounded-md bg-gray-25 text-gray-700 text-xs font-medium leading-[18px] group-hover/tip:block'>{t('common.tag.editTag')}</span>
</div>
)
}
diff --git a/web/app/components/share/text-generation/run-once/index.tsx b/web/app/components/share/text-generation/run-once/index.tsx
index dfe08780669..e03efce3bb8 100644
--- a/web/app/components/share/text-generation/run-once/index.tsx
+++ b/web/app/components/share/text-generation/run-once/index.tsx
@@ -65,6 +65,12 @@ const RunOnce: FC<IRunOnceProps> = ({
placeholder={`${item.name}${!item.required ? `(${t('appDebug.variableTable.optional')})` : ''}`}
value={inputs[item.key]}
onChange={(e) => { onInputsChange({ ...inputs, [item.key]: e.target.value }) }}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ e.preventDefault()
+ onSend()
+ }
+ }}
maxLength={item.max_length || DEFAULT_VALUE_MAX_LEN}
/>
)}