-
Notifications
You must be signed in to change notification settings - Fork 426
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
In mixed mode adding and removing tags leave spaces #983
Comments
Here is a codepen showing the issue: result: tagify_bug.mp4 |
The extra space after a tag comes from this setting and I am expecting the user to see a space was automatically added after the tag, and also to remove that space if a tag was removed. I can remove that space for the user if a tag was deleted. There are TONS of browser bugs related to |
Well, |
Actually I narrowed it down. When Tagify is inited with textarea it adds an extra \n to the value when user types something and the change event happen. When later on the textarea.value is set directly and change event is triggered - there is no extra \n I solved it currently by triggering a custom change event that doesn't clear the \n on direct change. So it is ok for me. All good! |
When using mixed mode, an extra space is always added behind the tag when added with addTags or addMixTags.
The problem is also when the tag is removed after that, the space remain. so you eventually end up with a lot of spaces,
Sometimes it might be convenient to add a space - but it should be also auto cleared. Maybe add an option to auto add space or not on tag insert.
Also by rapidly adding and deleting tags, a Zero Width Space (8203) seems to get left sometime in the code,. So a clean up when synching to the underlying textarea might be needed.
Second problem is that, again in mixed mode, there is always an enter (\n) generated at the end - even if no enter was used. This happen when using Tagify bound to a textarea.
So to solve this we have to clean the last enter each time, but then we don't know if the user maybe really pressed an enter and want to keep it.
The text was updated successfully, but these errors were encountered: