-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new delimiter option #51
base: master
Are you sure you want to change the base?
Conversation
You don't need to keep a map with keys, there is key property on the event object. The current code don't use it but you can change it. |
I made the suggested changes and updated all instances of Thanks! |
I would add: var key = event.key.toUpperCase(); to make sure that the name of the key is correct. Also you need to update this line: nativeInputValueSetter.call(this._input, this._tags.join(',')); and this._tags = this._input.value.split(/\s*,\s*/).filter(Boolean); To use delimiter. I'm also not sure if you should even update the keydown event, the issue was about the delimiter in |
I’m not quite sure I understand your message. The idea behind the delimiter is to create a tag when a specific key is pressed. Isn’t the keydown event responsible for handling key presses? I thought that’s where we would handle the new input tag. Could you clarify your thoughts on this? |
No, delimiter is not when a specific key is pressed, the issue was about input element. Delimiter is something in between, like |
Please read the issue you're closing:
key word is "initializing" |
Motivation:
Currently, the library only allows a comma as the delimiter. This limitation restricts user flexibility in tag entry. By adding support for customs delimiters, users can customize their input experience and improve usability.
Proposed Solution:
A map of additional characters has been added to be accepted as delimiters. If none are provided, the comma (,) will be used by default. This change facilitates the addition of new characters in the future. A new option has also been created to allow users to customize their delimiter preferences.
Usage:
in React:
Links:
Close #39
Note: This is one of my first contributions to open source. Please feel free to suggest any changes or improvements.