palantir/blueprint

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

Open

#3,425 创建于 2019年3月16日

在 GitHub 查看
 (2 评论) (2 反应) (0 负责人)TypeScript (20,263 star) (2,167 fork)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.

贡献者指南

Suggest Component should have an easy way to prevent an empty menu from showing. · palantir/blueprint#3425 | Good First Issue