mirror of https://github.com/langgenius/dify.git
fix: two web bugs for json-schema-config-modal (#27718)
This commit is contained in:
parent
c85c87f3da
commit
9c01d3e775
|
|
@ -12,7 +12,10 @@ const AddField = () => {
|
||||||
|
|
||||||
const handleAddField = useCallback(() => {
|
const handleAddField = useCallback(() => {
|
||||||
setIsAddingNewField(true)
|
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])
|
}, [setIsAddingNewField, emit])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,8 @@ const EditCard: FC<EditCardProps> = ({
|
||||||
}, [emit, path, parentPath, fields, currentFields])
|
}, [emit, path, parentPath, fields, currentFields])
|
||||||
|
|
||||||
const handlePropertyNameChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
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(() => {
|
const handlePropertyNameBlur = useCallback(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue