make separator configurable
it's still comma by default but you can pass { separator: ' ' } or { separator: ':' } as an option argument when creating tags-input
Thought: what about having it be an attribute on the input?
<input type="tags" data-separator=":" value="foo:bar:baz">
Yup. Much better. Let me rework it.
Some fixes:
- implemented
data-separator - fixed char detection - Safari does not actually support neither
keynorcharonkeydownevents - we need to parse keyIdentifier to properly detect separator char
How can one specify multible seperators? E.g. "," and enter?
@luckydonald by pasting
@luckydonald - enter and tab is always a separator, as for others you can specify a string with multiple charactes - see: https://pirxpilot.github.io/tags-input/
Source for the demo is here: https://github.com/code42day/tags-input/blob/next/index.html
Ah now I see what was being asked haha. Nice demo @pirxpilot
Detecting keys is tricky, not all documented properties are set on all events. For example charCode is not set in most browsers on keyDown.
see: https://dvcs.w3.org/hg/d4e/raw-file/tip/key-event-test.html
🙏
@0xc00010ff check @pirxpilot 's fork https://github.com/pirxpilot/tags-input