if deleted key is pressed before a single character in a new line, the node before it also gets deleted
https://jsbin.com/yehevewitu/edit?html,js,output
This will not happen when copy & paste. Please type it one by one character.
This happens in the newest chrome and I think this is not a matter of browser.
This line causes this matter.
https://github.com/yairEO/tagify/blob/67546600a23ee3c75cf32add4cd18d9f99d92bf2/src/tagify.js#L689-L691
In this case
currentValue: aaa<div>bbb</div><div><br></div> lastInputValue: aaa<div>bbb</div><div>c</div>
so this meets the following condition and 'ccc' is removed by this.removeTags
!selection.anchorOffset && currentValue.length >= lastInputValue.length
when these characters are copied&pasted
currentValue: aaa bbb <br>
lastInputValue:
aaa bbb c<br>
(both values include line feed code) This issue will not happen because this doesn't meet the condition.
I hope this helps you!
Seems to work fine in Chrome. Which browser are you using?
If you've pressed Shift+Enter this wouldn't have happen :)
Thanks for reporting