fix: default value of input field in form content editor

This commit is contained in:
JzoNg 2026-01-22 14:49:38 +08:00
parent b242578b86
commit 45c2167e0f
1 changed files with 5 additions and 3 deletions

View File

@ -71,17 +71,19 @@ const HITLInputComponentUI: FC<HITLInputComponentUIProps> = ({
if (editBtn)
editBtn.removeEventListener('click', showEditModal)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
const removeBtnRef = useRef<HTMLDivElement>(null)
useEffect(() => {
const removeBtn = removeBtnRef.current
const removeHandler = () => onRemove(varName)
if (removeBtn)
removeBtn.addEventListener('click', () => onRemove(varName))
removeBtn.addEventListener('click', removeHandler)
return () => {
if (removeBtn)
removeBtn.removeEventListener('click', () => onRemove(varName))
removeBtn.removeEventListener('click', removeHandler)
}
}, [onRemove, varName])
@ -123,7 +125,7 @@ const HITLInputComponentUI: FC<HITLInputComponentUIProps> = ({
/>
)}
{!isPlaceholderVariable && (
<div className="system-xs-medium max-w-full truncate text-text-quaternary">{formInput.placeholder.value}</div>
<div className="system-xs-medium max-w-full truncate text-components-input-text-filled">{formInput.placeholder.value}</div>
)}
</div>