Skip to content

Commit

Permalink
fix filtering when groupFilter exists
Browse files Browse the repository at this point in the history
this fixes an issue where, when a filter text is entered and a group becomes empty, it crashes  with a `TypeError: groups[groupValue] is not iterable (cannot read property undefined)`
  • Loading branch information
andreasnuesslein authored Jun 21, 2022
1 parent ceac360 commit afdf029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
const sortedGroupedItems = [];
groupFilter(groupValues).forEach((groupValue) => {
sortedGroupedItems.push(...groups[groupValue]);
if (groups[groupValue]) sortedGroupedItems.push(...groups[groupValue]);
});
return sortedGroupedItems;
Expand Down

0 comments on commit afdf029

Please sign in to comment.