1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #~: Minor fix onblur attribute function (#2065)

This commit is contained in:
Sergio Betanzos 2022-05-19 16:41:29 +02:00 committed by GitHub
parent cebaac8477
commit e8bcf1175f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,14 @@ const AttributeCreateForm = memo(({ handleAdd }) => {
}
}
const handleBlur = (evt) => handleSubmit(handleCreateAttribute)(evt)
const handleBlur = (evt) => {
const nextTarget = evt.relatedTarget?.name
// If the next target isn't the name or value input, submit the form
if (![nameInputKey, valueInputKey].includes(nextTarget)) {
handleSubmit(handleCreateAttribute)(evt)
}
}
return (
<>