blueprint icon indicating copy to clipboard operation
blueprint copied to clipboard

[MultiSelect2] feat: allow create multiple items

Open ZeRego opened this issue 3 years ago • 3 comments

Fixes #5384

Checklist

  • [x] Includes tests
  • [x] Update documentation

Changes proposed in this pull request:

  • Change createNewItemFromQuery to support array of new items

Reviewers should focus on:

  • Unsure how wouldCreatedItemMatchSomeExistingItem should 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

create multiple

ZeRego avatar Jul 10 '22 11:07 ZeRego

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.

palantirtech avatar Jul 10 '22 11:07 palantirtech

ping @ZeRego, any interest in continuing this PR?

adidahiya avatar Sep 14 '22 17:09 adidahiya

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 avatar Sep 21 '22 20:09 ZeRego

@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.

adidahiya avatar Sep 22 '22 15:09 adidahiya

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.

adidahiya avatar Sep 23 '22 15:09 adidahiya