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 (2,167 fork)batch import
P2Package: selectType: bughelp wanted

倉庫指標

Star
 (20,263 star)
PR 合併指標
 (平均合併 43天 10小時) (30 天內合併 27 個 PR)

描述

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.

貢獻者指南