Skip to content

Commit

Permalink
Fix:Empty link in record details isn't deleted by default (#9840)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Etienne <[email protected]>
  • Loading branch information
3 people authored Feb 4, 2025
1 parent c9f45a3 commit 0675017
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0675017

Please sign in to comment.