From 8d0c971906ff39a1b1a670a7c0181a958c1f77d8 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 19 Mar 2025 12:20:54 +0200 Subject: [PATCH] Show empty AND values --- src/Presentation/ListFacetHtmlBuilder.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Presentation/ListFacetHtmlBuilder.php b/src/Presentation/ListFacetHtmlBuilder.php index 02c9db5..2bdd431 100644 --- a/src/Presentation/ListFacetHtmlBuilder.php +++ b/src/Presentation/ListFacetHtmlBuilder.php @@ -32,7 +32,15 @@ public function __construct( public function buildHtml( FacetConfig $config, PropertyConstraints $state ): string { $valueCounts = $this->getValuesAndCounts( $config ); - if ( count( $valueCounts ) === 0 ) { + + if ( $valueCounts === [] && $state->getAndSelectedValues() !== [] ) { + $valueCounts = array_map( + fn( $value ) => new ValueCount( $value, 0 ), + $state->getAndSelectedValues() + ); + } + + if ( $valueCounts === [] ) { return ''; }