Skip to content

Commit 1ca82cd

Browse files
fix filter pill values for option groups
1 parent 8d6e6aa commit 1ca82cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Views/Filters/MultiSelectDropdownFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function getFilterPillValue($value): ?string
6868
$values = [];
6969

7070
foreach ($value as $item) {
71-
$found = $this->getCustomFilterPillValue($item) ?? $this->getOptions()[$item] ?? null;
71+
$found = $this->getCustomFilterPillValue($item)
72+
?? collect($this->getOptions())
73+
->mapWithKeys(fn ($options, $optgroupLabel) => is_iterable($options) ? $options : [$optgroupLabel => $options])[$item]
74+
?? null;
7275

7376
if ($found) {
7477
$values[] = $found;

0 commit comments

Comments
 (0)