[New Component] MultiSelect input with search (also usable as searchable single select)

未关闭
#1,338 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
12/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
bootstrap, csharp
领域
frontend

调研方向

The target location is blazorbootstrap/Components/Form/MultiSelectInput/, which does not exist yet, so start by reading the existing form input components in blazorbootstrap/Components/Form/ and the docs page pattern under docs/docs/04-forms/. This is a large multi-part feature with a contested scope, so it is better suited to a maintainer discussion than a first contribution. Done would mean the v1 checklist in the issue is met, which is well beyond a single change.

由索引模型根据 Issue 内容生成。

描述

area-autocomplete area-forms area-multi-select new component

Summary

Add a MultiSelectInput<TItem, TValue> dropdown component with built-in search, select-all, chip display, grouping, and virtualization. A single-selection mode covers the "searchable select" request.

Motivation

This is the most requested missing component, both in this repository and across the Blazor UI ecosystem:

  • Search inside select control — #559
  • Select component with filter — #1133
  • Allow AutoComplete to function as a dropdown — #1144
  • Dropdown with search field — #579, #854

Proposed API (draft)

<EditForm Model="filter">
    <MultiSelectInput TItem="Employee" TValue="int"
                      Data="employees"
                      TextField="e => e.Name"
                      ValueField="e => e.Id"
                      GroupBy="e => e.Department"
                      @bind-Value="filter.EmployeeIds"
                      AllowSearch="true" ShowSelectAll="true"
                      SelectedDisplay="MultiSelectDisplay.Chips" />
</EditForm>

<MultiSelectInput TItem="Country" TValue="string" SelectionMode="MultiSelectMode.Single"
                  DataProvider="CountriesProvider" @bind-SelectedValue="countryCode" />

Must-have features (v1)

  • Multiple mode: Value / ValueChanged / ValueExpression as IEnumerable<TValue> with EditForm validation.
  • Single mode: SelectedValue binding — searchable replacement for <select>.
  • Data sources: Data (client-side filter) and DataProvider (server-side search with debounce and loading indicator).
  • Search box inside the dropdown (AllowSearch), with FilterOperator (Contains, StartsWith).
  • Select all / Clear all; MaxSelectedItems.
  • SelectedDisplay (MultiSelectDisplay: Chips with remove buttons, Count summary "3 selected", Comma list).
  • Option grouping (GroupBy), disabled options (DisabledSelector), ItemTemplate.
  • Virtualization for large data sets.
  • Size (MultiSelectInputSize), Disabled, Placeholder, ShowClearButton.
  • Dropdown positions correctly inside Modal, Offcanvas, and scrollable containers.
  • Search input stays responsive on Blazor Server under latency (see #407 / #1247).

Accessibility

  • Combobox + listbox ARIA pattern; aria-multiselectable in multiple mode.
  • Arrow keys, Home/End, Enter/Space to toggle, Escape to close, type-ahead.
  • Selected count announced via a polite live region.

Out of scope (later)

  • Creating a new option from search text.
  • Cascading selects.

Acceptance criteria

  • Component in blazorbootstrap/Components/Form/MultiSelectInput/.
  • XML docs on all public parameters and events.
  • Demo page covering: multiple, single searchable, client data, server data provider, grouping, select all, max items, display modes, templates, disabled options, virtualization, inside Modal, EditForm validation.
  • Verified in Server and WebAssembly demo hosts.
  • Docs page docs/docs/04-forms/multi-select-input.mdx.
  • Builds for .NET 8, 9, 10.

Related

#559, #1133, #1144, #579, #854, #574

主要语言
HTML
星标
1.2k
派生
111
平均合并
4 分钟
30 天内合并 PR
55

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vikramlearning/blazorbootstrap 的其他 Issue

查看 vikramlearning/blazorbootstrap 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。