I am using the tag input created in Angular. The problem which I am facing is that whenever I hit backspace for the last character, it removes the previous tag as well.
I don't to remove the previous tag as soon as the input is empty, I want to to remove when the user hits backspace for the second time. For Example in Gmail when we compose a new email and send to multiple email Ids.
This is happening because of the following code :
if (event.code === 'Backspace' && !inputValue) {
this.removeTag();
return;
}
I have tried a lot of things but couldn't fix this bug.
Here is a stackblitz link for it : Stackblitz Link
How should I solve it?