mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:06:51 +08:00
fix: align object value remove button of chat variable (#35616)
This commit is contained in:
parent
0c280ef708
commit
3e4849d765
@ -5,7 +5,7 @@ import { produce } from 'immer'
|
||||
import * as React from 'react'
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import RemoveButton from '@/app/components/workflow/nodes/_base/components/remove-button'
|
||||
import ActionButton from '@/app/components/base/action-button'
|
||||
import VariableTypeSelector from '@/app/components/workflow/panel/chat-variable-panel/components/variable-type-select'
|
||||
import { ChatVarType } from '@/app/components/workflow/panel/chat-variable-panel/type'
|
||||
|
||||
@ -116,7 +116,7 @@ const ObjectValueItem: FC<Props> = ({
|
||||
{/* Value */}
|
||||
<div className="relative w-[230px]">
|
||||
<input
|
||||
className="block h-7 w-full appearance-none px-2 system-xs-regular text-text-secondary caret-primary-600 outline-hidden placeholder:system-xs-regular placeholder:text-components-input-text-placeholder hover:bg-state-base-hover focus:bg-components-input-bg-active"
|
||||
className="block h-7 w-full appearance-none px-2 pr-9 system-xs-regular text-text-secondary caret-primary-600 outline-hidden placeholder:system-xs-regular placeholder:text-components-input-text-placeholder hover:bg-state-base-hover focus:bg-components-input-bg-active"
|
||||
placeholder={t('chatVariable.modal.objectValue', { ns: 'workflow' }) || ''}
|
||||
value={list[index].value}
|
||||
onChange={handleValueChange(index)}
|
||||
@ -125,10 +125,15 @@ const ObjectValueItem: FC<Props> = ({
|
||||
type={list[index].type === ChatVarType.Number ? 'number' : 'text'}
|
||||
/>
|
||||
{list.length > 1 && !isFocus && (
|
||||
<RemoveButton
|
||||
className="absolute top-0.5 right-1 z-10 hidden group-hover:block"
|
||||
onClick={handleItemRemove(index)}
|
||||
/>
|
||||
<div className="absolute top-0.5 right-1 z-10">
|
||||
<ActionButton
|
||||
size="m"
|
||||
className="group hover:bg-state-destructive-hover!"
|
||||
onClick={handleItemRemove(index)}
|
||||
>
|
||||
<span className="i-ri-delete-bin-line h-4 w-4 text-text-tertiary group-hover:text-text-destructive" />
|
||||
</ActionButton>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user