Skip to content

Commit

Permalink
Merge pull request #1044 from AssetFlw/dev-master
Browse files Browse the repository at this point in the history
fix filter pill values for option groups
  • Loading branch information
rappasoft authored Feb 15, 2023
2 parents 94177d0 + d430906 commit 5b50740
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Views/Filters/MultiSelectDropdownFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public function getFilterPillValue($value): ?string
$values = [];

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

if ($found) {
$values[] = $found;
Expand Down

0 comments on commit 5b50740

Please sign in to comment.