Skip to content
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

Fix Combobox filtering with custom itemToString #495

Merged
merged 4 commits into from
Mar 7, 2019

Conversation

colinking
Copy link
Contributor

Fixes: #215

If you supply an itemToString to an Autocomplete / Combobox, we will now correctly fuzzy filter on the string values.

Before After
image image

@colinking colinking force-pushed the colin/item-to-string-autocomplete branch 5 times, most recently from 5692c0c to 6319b07 Compare February 9, 2019 22:06
@colinking colinking force-pushed the colin/item-to-string-autocomplete branch from 6319b07 to 0f06c74 Compare February 9, 2019 22:17
Rowno
Rowno previously requested changes Feb 11, 2019
package.json Outdated
@@ -24,7 +24,7 @@
"sideEffects": false,
"scripts": {
"test": "xo && ava",
"prepublishOnly": "rm -rf esm commonjs && yarn run build",
"prepare": "rm -rf esm commonjs && yarn run build",
Copy link
Contributor

@Rowno Rowno Feb 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this? prepublishOnly is an npm lifecycle hook that makes sure evergreen is rebuilt automatically when people publish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, so is prepare :) https://docs.npmjs.com/misc/scripts#description

I wish npm had a separate object for lifecycle hooks (lifecycle: { prepare: ... }), so that this is less so black magic 😬

But from the docs (prepare is a superset of prepublishOnly):

prepare: Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly.
prepublishOnly: Run BEFORE the package is prepared and packed, ONLY on npm publish. (See below.)

Admittedly, I forgot this was still here -- I was mainly using it for testing in another repo. But in general, this hook builds evergreen when you add it as a dependency, which allows you to reference a git branch (f.e. "evergreen-ui": "segmentio/evergreen#colin/item-to-string-autocomplete",). It's pretty useful for testing a branch like this out in a production setting.

However, not really sure if we want to include this change since it may slow down install times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting this change and dismissing the review so I can ship this :)

@colinking colinking dismissed Rowno’s stale review March 7, 2019 06:59

Reverted the package.json change

@colinking
Copy link
Contributor Author

Merged master + double-checked that all storybook entries for Autocomplete and Combobox worked.

@colinking colinking merged commit dcb4c8f into master Mar 7, 2019
@colinking colinking deleted the colin/item-to-string-autocomplete branch March 7, 2019 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants