Skip to content

feat(MultiSelect): hide select all when search yields no results#577

Merged
mrholek merged 3 commits into
mainfrom
feat/multi-select-hide-select-all-on-search-no-results
Jul 13, 2026
Merged

feat(MultiSelect): hide select all when search yields no results#577
mrholek merged 3 commits into
mainfrom
feat/multi-select-hide-select-all-on-search-no-results

Conversation

@mrholek

@mrholek mrholek commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds the hideSelectAllOnSearchNoResults option to the Multi Select component (default true).

When search is enabled and the query matches no options, leaving the select all button above the empty "No results found" message is misleading — there is nothing left to select. By default the component now hides the dropdown header in that case and restores it as soon as the search matches at least one option again.

Set hideSelectAllOnSearchNoResults: false to keep the header (and the select all button) visible even with no results. The option only affects the built-in select all button — a custom headerTemplate is always rendered.

Changes

  • js/src/multi-select.js: new hideSelectAllOnSearchNoResults config option, header reference tracking, and _updateSelectAllVisibility() wired into the search filter.
  • docs/content/forms/multi-select.md: new "Hiding select all when search has no results" subsection (with two interactive examples) and an API table entry, marked added-in 5.27.0.
  • Unit tests covering the default hide behaviour and the false opt-out.

Testing

  • karma unit suite: 2971 passing.

Add the `hideSelectAllOnSearchNoResults` option (default `true`). When a
search filter leaves no matching options, the dropdown header with the
built-in select all button is hidden, and restored once the search matches
again. Set the option to `false` to keep the button visible. Custom
`headerTemplate` headers are unaffected.
@coveralls

coveralls commented Jun 16, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 29293626956

Coverage increased (+0.008%) to 94.636%

Details

  • Coverage increased (+0.008%) from the base build.
  • Patch coverage: 8 of 8 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7463
Covered Lines: 7187
Line Coverage: 96.3%
Relevant Branches: 3088
Covered Branches: 2798
Branch Coverage: 90.61%
Branches in Coverage %: Yes
Coverage Strength: 771.04 hits per line

💛 - Coveralls

@mrholek mrholek merged commit b9ec55f into main Jul 13, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants