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

Suggest Component should have an easy way to prevent an empty menu from showing. #3425

Open
tnrich opened this issue Mar 16, 2019 · 2 comments

Comments

@tnrich
Copy link
Contributor

tnrich commented Mar 16, 2019

Hey @giladgray @adidahiya
image

In the above image I have a <Suggest/> with the prop

initialContent={null}

Instead of showing the weird little empty menu, I'd rather not show anything. There doesn't seem to be an easy way to do this besides implementing an entire itemListRenderer override. I think that passing initialContent={null} should completely hide the Menu.

To do that all that would seemingly need to change is here:

const createItemView = this.isCreateItemRendered() ? this.renderCreateItemMenuItem(this.state.query) : null;

If we added the this

if (menuContent === null && createItemView === null) {
  return null
}

to the next line then that weird empty menu wouldn't show up.

@zimeibian
Copy link

Hi, is this issue resolved? I'm still seeing the empty menu pop up on the Suggest component with initialContent=null on @blueprintjs/select 3.16.6 (https://codesandbox.io/s/blueprint-suggest-initialcontentnull-2sz9f?file=/src/index.tsx)

@pvcnt
Copy link

pvcnt commented Jul 9, 2024

I am also hitting this. My workaround is to always display some initial content, but I would prefer having nothing shown (as with the Omnibar).

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

No branches or pull requests

4 participants