Merge remote-tracking branch 'origin/main' into feat/trigger

This commit is contained in:
lyzno1
2025-11-04 09:55:43 +08:00
4 changed files with 14 additions and 10 deletions

View File

@ -12,7 +12,10 @@ const AddField = () => {
const handleAddField = useCallback(() => {
setIsAddingNewField(true)
emit('addField', { path: [] })
// fix: when user change the last property type, the 'hoveringProperty' value will be reset by 'setHoveringPropertyDebounced(null)', that cause the EditCard not showing
setTimeout(() => {
emit('addField', { path: [] })
}, 100)
}, [setIsAddingNewField, emit])
return (

View File

@ -122,7 +122,8 @@ const EditCard: FC<EditCardProps> = ({
}, [emit, path, parentPath, fields, currentFields])
const handlePropertyNameChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
setCurrentFields(prev => ({ ...prev, name: e.target.value }))
// fix: when user add name contains space, the variable reference will not work
setCurrentFields(prev => ({ ...prev, name: e.target.value?.trim() }))
}, [])
const handlePropertyNameBlur = useCallback(() => {