Comma doesn't work as delimiter for v6
mmmavis opened this issue · 2 comments
Hi! I recently upgraded react-tag-autocomplete
to v6 and realized that comma no longer works as delimiter. Wondering if this change was intended or I missed something in the doc or my code.
I've updated the delimiter array from [9, 13, 188]
to [`Tab`, `Enter`, `Comma`]
. Tab and Enter both work fine still but not Comma.
Hi @mmmavis - detecting commas should work however a quick test shows that punctuation keys are reported as their literal characters rather than a description, so if you use ["Tab", "Enter", ","]
this should do the job.
There's also a full reference of key codes available here: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values - I should probably add a link to this in the readme.
Got it. Thanks for looking into this!