zurb / tribute

ES6 Native @mentions
https://zurb.github.io/tribute/example/
MIT License
2.03k stars 304 forks source link

Issue with Deleting Mention via Programmatic Trigger in Tribute.js #905

Closed Noah-Ywh closed 5 months ago

Noah-Ywh commented 5 months ago

Hello Tribute.js Team, I am reaching out to report an issue I have encountered while using Tribute.js. After triggering a mention programmatically, it appears that I cannot delete the mention. I have followed the documentation to implement the feature but seem to have hit a snag with this particular functionality.

To be more specific, the problem can be observed in the first example on the Tribute page (https://zurb.github.io/tribute/example/). When a mention is added programmatically through the API, it seems impossible to remove it from the input/textarea.

However, I noticed that if I press the enter key to insert a new line after the mention, and then press the delete key, it removes the mention along with the new line.

Steps to reproduce 1、Trigger a mention programmatically using Tribute's API. 2、Attempt to delete the mention from the input/textarea field.

Expected Behavior The mention should be deletable after being triggered programmatically.

Actual Behavior The mention cannot be deleted, and appears to be "stuck" in the input/textarea field.

I would really appreciate it if you could provide some guidance or a fix for this issue. Thank you for your time and assistance. Best regards,