Skip to content

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

Open
mrholek wants to merge 1 commit into
mainfrom
feat/multi-select-hide-select-all-on-search-no-results
Open

feat(MultiSelect): hide select all when search yields no results#577
mrholek wants to merge 1 commit 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

Copy link
Copy Markdown

Coverage Report for CI Build 27610540826

Coverage decreased (-0.04%) to 94.606%

Details

  • Coverage decreased (-0.04%) from the base build.
  • Patch coverage: 8 of 8 lines across 1 file are fully covered (100%).
  • 4 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

4 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
js/src/range-slider.js 3 94.61%
js/src/navigation.js 1 64.19%

Coverage Stats

Coverage Status
Relevant Lines: 7440
Covered Lines: 7163
Line Coverage: 96.28%
Relevant Branches: 3071
Covered Branches: 2781
Branch Coverage: 90.56%
Branches in Coverage %: Yes
Coverage Strength: 720.63 hits per line

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

Labels

None yet

2 participants