The Wayback Machine - https://web.archive.org/web/20201203192129/https://github.com/palantir/blueprint/issues/3864
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

Documentation for renderFilteredItems() #3864

Open
ViggoV opened this issue Nov 21, 2019 · 2 comments
Open

Documentation for renderFilteredItems() #3864

ViggoV opened this issue Nov 21, 2019 · 2 comments

Comments

@ViggoV
Copy link

@ViggoV ViggoV commented Nov 21, 2019

Environment

Question

Is there any solid documentation for the renderFilteredItems() utility function exported from the select package? It is briefly mentioned under the itemListRenderer props section of the select component documentation, but the only other mention I can find of it is in this issue #3281 ans well as a brief mention in a changelog.

In the itemListRenderer props section it is stated that it supports a noResults state, but it doesn't say how to use it and it doesn't render the noResults defined on the Select/Suggest component..

@ViggoV
Copy link
Author

@ViggoV ViggoV commented Nov 21, 2019

I figured it out. Would be nice with a short entry in the docs though.

To other confused souls:
Pass the first and only argument given to the itemListRenderer directly on as the first argument for renderFilteredItems, which will render the filtered items as defined in your itemRenderer. Then you can pass a component for displaying noResults as the second argument:

<Suggest
  // ...
  itemListRenderer={props => (
    <SomeMenuComponent>
      {renderFilteredItems(props, <SomeNoResultsComponent />)}
    </SomeMenuComponent>
  )}
  // ...
/>

I assume the same is the case for the third argument, which would then represent an initalContent component

@giladgray
Copy link
Contributor

@giladgray giladgray commented Dec 15, 2019

the code itself is documented, which should appear in an editor. sorry it's not on the site.
https://github.com/palantir/blueprint/blob/develop/packages/select/src/common/itemListRenderer.ts#L68-L83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.