Closed romansp closed 2 weeks ago
We also need to apply the changes to handlePaste
@zernonia thanks for the review.
We also need to apply the changes to handlePaste
I don't think any additional changes are needed for
handlePaste
.String.prototype.split
accepts RegExp argument. I tested it with/[ ,;]+/
and it worked as expected on paste. But maybe you meant something else?
Would you like me to add an example to docs showcasing multiple delimiters usage?
PR updated:
replace
instead of replaceAll
to not require global
flag on regexpdelimiter
prop descriptionNicely done @romansp !! Working well! 🚀
We have freeze any new feature to main
branch, perhaps we can push this to v2
? 😁
Also, do you mind quickly adding in some test case for this?
@zernonia Thanks! I'm good with this being pushed to v2
. Do you want me to change target branch or you do it?
Let me check what type of test case we can add here. We could probably verify that typing text with delimiters creates tags correctly? I will try to add coverage for paste event as well.
Super welcome @romansp !! Once again thanks for the PR! Sorry I messed up the branch, I've cherry-picked your commit to https://github.com/unovue/radix-vue/pull/1414 😁
Resolves #1400.
Added support for
RegExp
delimiter prop inTagsInput
.Open questions:
global
flag is set. Withoutglobal
flagString.prototype.replaceAll
will produce the following error:Uncaught TypeError: String.prototype.replaceAll called with a non-global RegExp argument
string[]
delimiter. If we do then decide:string[]
intoRegExp
. Seems somewhat tricky to do it correctly and account for all the edge cases, e.g. escaping special characters.handleInput
andhandlePaste
.Do you have any thoughts on these @zernonia? Or maybe other suggestions?