[MultiSelect2] feat: allow create multiple items
Fixes #5384
Checklist
- [x] Includes tests
- [x] Update documentation
Changes proposed in this pull request:
- Change
createNewItemFromQueryto support array of new items
Reviewers should focus on:
- Unsure how
wouldCreatedItemMatchSomeExistingItemshould behave. Since the logic for splitting the query into multiple items is on the user implementation side, it will display the create item option when there is only a partial match. E.g: query "test, test1" items are "test" and "test1" and test already exists in the list. We would still show the create item option - I wrote a test but I don't know why it is failing and how to debug tests. Can you provide more info on how to run tests in debug mode ?
Screenshot

Thanks for your interest in palantir/blueprint, @ZeRego! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.
ping @ZeRego, any interest in continuing this PR?
ping @ZeRego, any interest in continuing this PR?
@adidahiya Sorry for the delay.
Testing was a bit of a pain since I couldn't figure out how to run the tests with breakpoints in Webstorm IDE.
I had to add .skip to all the tests beside the select2 and use console logs to figure out what was happening.
Looks like I was missing the event keydown even though the other tests only have the keyup event so I'm now confused on how those tests are passing 🤷
@ZeRego I'll take a look at your updates. In the future, please don't force-push to PR branches; I like to see all the commits in their original timeline. I squash all PRs into a single commit when merging.
please update packages/select/karma.conf.js:
My suggestion above didn't work, for some reason Karma doesn't allow me to match those globs on files outside the current working directory. I've added a commit here which uses /* istanbul ignore next */ instead.