diff --git a/src/app/RecordingMetadata/RecordingLabelFields.tsx b/src/app/RecordingMetadata/RecordingLabelFields.tsx index 58e38aa0e..2bb700f5e 100644 --- a/src/app/RecordingMetadata/RecordingLabelFields.tsx +++ b/src/app/RecordingMetadata/RecordingLabelFields.tsx @@ -66,11 +66,13 @@ export const RecordingLabelFields: React.FC = ({ const handleLabelEdit = React.useCallback( (idx: number, keyValue: string) => { const label = getLabelFromInput(keyValue); + const updatedLabels = [...labels]; if (label) { - const updatedLabels = [...labels]; updatedLabels[idx] = label; - setLabels(updatedLabels); + } else { + updatedLabels.splice(idx); } + setLabels(updatedLabels); }, [labels, setLabels], ); @@ -188,7 +190,7 @@ export const RecordingLabelFields: React.FC = ({ )}