Skip to content

Commit d617f97

Browse files
committed
fix: list item can crash if element.getElement is undefined
1 parent a4030e2 commit d617f97

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/list/src/Item.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@
336336
}
337337
338338
function addTabindexIfNoItemsSelected() {
339+
if (!element) {
340+
return;
341+
}
342+
339343
// Look through next siblings to see if none of them are selected.
340344
let noneSelected = true;
341345
let el = element.getElement();

0 commit comments

Comments
 (0)