From afdf029c9f2be1b88b22bdfae4f91b5581ffcfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20N=C3=BC=C3=9Flein?= Date: Tue, 21 Jun 2022 13:14:16 +0100 Subject: [PATCH] fix filtering when groupFilter exists 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)` --- src/Select.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Select.svelte b/src/Select.svelte index fbef1b96..4afbc815 100644 --- a/src/Select.svelte +++ b/src/Select.svelte @@ -281,7 +281,7 @@ const sortedGroupedItems = []; groupFilter(groupValues).forEach((groupValue) => { - sortedGroupedItems.push(...groups[groupValue]); + if (groups[groupValue]) sortedGroupedItems.push(...groups[groupValue]); }); return sortedGroupedItems;