palantir/blueprint

[Select2] Better support for "sticky" items

Open

#6,080 建立於 2023年4月19日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
P2Package: selectType: feature requesthelp wanted

描述

Feature request

There's currently no way to easily add "stick" items to be rendered within a Select2. There's currently support for createNewItem* features, where you can place this "create new item" either first or last in the last. However, there's no way to make this item last while also having it always render in the Select2 (if last, it may have to be scrolled to if there are enough items before it), so the only way to guarantee this "create new item" will be shown is to render it first. In addition to createNewItemPosition, it would be nice to support some kind of isCreateNewItemSticky: boolean that would cause the item to be sticky at either the top or bottom of the list depending on createNewItemPosition.

Note: this UX is probably most likely hit with createNewItem* features, and probably easiest to implement if we focus on only this item, but I could imagine some other more generalized solutions that allow us to make arbitrary items in the list as "sticky" that could be useful (e.g. maybe scrolling a long list of options separated by header dividers, you may want the currently viewed section's header to be sticky at the top as you scroll)

貢獻者指南