Skip to content

Commit

Permalink
handled input value empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucifer4255 committed Jan 29, 2025
1 parent be67645 commit bdc6481
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ export const MultiItemFieldInput = <T,>({
}
}

if (inputValue === '' && isAddingNewItem) {
return;
}

if (inputValue === '' && !isAddingNewItem) {
handleDeleteItem(itemToEditIndex);
return;
}
if (isClearingInput && itemToEditIndex !== -1) {
handleDeleteItem(itemToEditIndex);
return;
Expand Down

0 comments on commit bdc6481

Please sign in to comment.