Fix:Empty link in record details isn't deleted by default (#9840)

Gives a fix for #9780 . I have added handleDelete inside the submit
function and created a state to manage the empty placeholder
[Screencast from 2025-01-24
01-45-22.webm](https://github.com/user-attachments/assets/87b209a0-7f60-4d72-ad06-c8b955cf6cd2)

---------

Co-authored-by: etiennejouan <jouan.etienne@gmail.com>
Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
This commit is contained in:
Suhotra Dey
2025-02-04 20:34:34 +05:30
committed by GitHub
parent c9f45a30d6
commit 0675017b5e

View File

@ -128,6 +128,15 @@ export const MultiItemFieldInput = <T,>({
}
}
if (inputValue === '' && isAddingNewItem) {
return;
}
if (inputValue === '' && !isAddingNewItem) {
handleDeleteItem(itemToEditIndex);
return;
}
const newItem = formatInput
? formatInput(inputValue)
: (inputValue as unknown as T);