yairEO / tagify

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue
https://yaireo.github.io/tagify/
Other
3.48k stars 429 forks source link

Console warning on tag addition via enter key #1331

Closed gxleano closed 4 months ago

gxleano commented 4 months ago

Prerequisites

💥 Demo Page

https://jsbin.com/yayukiz/edit?html,js,output

Explanation

When adding a tag on the demo site by pressing the Enter key, a warning message appears in the console: [Tagify]: Cannot find element in Tag template: . .tagify__tag-text. However, this behavior does not occur when clicking instead.

gxleano commented 4 months ago

Seems like this change https://github.com/yairEO/tagify/commit/ff37bbfd13c899813c5c138889a61da17a51bff1#diff-3c4c0fff34c73a26f550ccf4ba326621e9651dad00c41c373f6abf384944cf8dR278, was the culprit.

'Enter' case shouldn't be fired from focused dropdown suggestions.

On previous versions it is working as expected.