tagify icon indicating copy to clipboard operation
tagify copied to clipboard

Quickly click to delete tag, there is a bug

Open wabgy opened this issue 3 years ago • 5 comments

Hello, there are the following two bugs 1). When entering the edit mode, change it to clicks: 1, enter the number 1, 2 becomes two tags, and quickly click the delete button, there is a chance to trigger the edit:start event method, and enter the number 1 or 2 again, it becomes Can't tag. 2). Double-click the input box, the console will prompt the message 'tag element doesn't exist'. please verify, thanks!

Sorry I don't know how to upload the video.

https://jsbin.com/becapidoqi/edit?js,console,output

wabgy avatar Sep 23 '22 09:09 wabgy

sorry but I don't understand, what is the actual bug?

yairEO avatar Sep 23 '22 20:09 yairEO

Sorry, this is the demo page. Enter the number 1, 2 becomes two tags,after triggering the edit:start event, you will find the following problems: 1). The first input content is deleted after generating the tag (it seems that the content already exists and is deleted). 2). Double-click the input box, the console will prompt the message 'tag element doesn't exist'.

please verify.

💥 Demo Page https://jsbin.com/tetixowayo/edit?js,console,output

https://user-images.githubusercontent.com/18025875/192176539-158fdcc1-49a1-4c35-9f90-eb6338494e9a.mp4

wabgy avatar Sep 26 '22 01:09 wabgy

I've tried so many times to delete as fast as I could but I could not reproduce the bug (in your JSBIN)

yairEO avatar Nov 12 '22 20:11 yairEO

Sorry to resurect an old issue but the same is happening here, it's easier to reproduce if you hold backspace to delete the tags.

LucasCardoso-LC avatar Jan 18 '24 17:01 LucasCardoso-LC

@LucasCardoso-LC - please upload a video. I cannot reproduce this at all... I've tried adding several tags and holding the BACKSPACE key and it always perfectly removes them all and the value of the original input is in-sync.

yairEO avatar Jan 23 '24 20:01 yairEO

I have also reproduced the issue and I am experiencing a similar problem.

Here is the issue I am facing:

When I quickly perform the following two steps after entering "1", the UI reflects both events, but the actual value change from the first event (deleting "1") is ignored.

  • First event: Delete "1".
  • Second event: Paste another value using cmd + v.

(Although the situation is different from the initially reported issue, both problems show that the value change from the first event is ignored.)

https://github.com/yairEO/tagify/assets/39703207/757b520e-e21e-4780-a250-f0d29126f267

SongTeaheon avatar Jun 20 '24 06:06 SongTeaheon

@SongTeaheon - thanks! that helped a lot, now I can reproduce it. I will create a fix shortly.

yairEO avatar Jun 22 '24 07:06 yairEO