yairEO / tagify

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

Tag with Value '0' is Not Selectable #1363

Closed DenwerOk closed 3 months ago

DenwerOk commented 3 months ago

Prerequisites

💥 Demo Page

React issue template: https://codesandbox.io/s/tagify-react-issue-template-forked-fs8fk4?file=/src/index.js

Explanation

Additional details: after a brief debug session the issue looks to be in the normalizeTags method during evaluating of isCollection variable: isCollection = isArray && tagsItems[0].value, In this case when value is not 0 the variable is evaluated as true, whereas if it's 0 it is evaluated as false. Possible solution: check for value 0 specifically.

yairEO commented 3 months ago

Sorry for the delay I was on a very long vacation