palantir/blueprint

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

Open

#3,425 opened on 2019年3月16日

GitHub で見る
 (2 comments) (2 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
P2Package: selectType: bughelp wanted

説明

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:

https://github.com/palantir/blueprint/blob/3d6f13e8af98225ad8ca5ea6309bb406fd218b3e/packages/select/src/components/query-list/queryList.tsx#L264

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.

コントリビューターガイド