Skip to content

feat: add select all button to MultiSelectComboBox - #10208

Merged
sissbruecker merged 4 commits into
mainfrom
feat/mscb-select-all
Sep 24, 2026
Merged

sissbruecker merged 4 commits into
mainfrom
feat/mscb-select-all

Conversation

@sissbruecker

Copy link
Copy Markdown
Member

Description

Part of vaadin/web-components#4590

  • Added setSelectAllButtonVisible(boolean) to MultiSelectComboBox for showing a select all button in the dropdown. The button is only supported with in-memory data providers. With a lazy data provider, the button is hidden and a warning is logged.
  • The web component supports two modes, and the Flow component switches between them based on the filtering mode:
    • Client-side filtering (all items fit into one page): the web component has all items, so it handles computing the button state and toggling the selection on its own. The new value syncs to the server like any other client-side selection.
    • Server-side filtering: the client only has the loaded pages, so it cannot know all items that match the filter. The server handles computing the button state and toggling the selection instead.
  • The switch between the modes is the private _allSelected property:
    • The connector always sets _toggleSelectAllHandler, which calls the toggleSelectAll() client callable
    • The web component only uses the handler, and takes the button label from _allSelected, while that property is set
    • With server-side filtering, the server sets _allSelected by fetching the filtered items from the data provider. With client-side filtering, it removes the property, so the web component falls back to local handling.
  • _allSelected is updated in a BeforeClientResponseAction after value changes, filter changes, data resets and data provider changes

Known Gaps

  • Select all state is calculated on every value change, even when the dropdown is closed. Acceptable.
  • No I18N support for customizing the button label. Will be done as follow up.
  • No Testbench API. Will be done as follow up.

Type of change

  • Feature

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Nothing to flag — the changes look good.

@sonarqubecloud

Copy link
Copy Markdown

@sissbruecker
sissbruecker added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit c4df185 Sep 24, 2026
27 checks passed
@sissbruecker
sissbruecker deleted the feat/mscb-select-all branch September 24, 2026 08:08
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.4.0-alpha1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants