fix(list-box-selection): use default translations if translateWithId is undefined

This commit is contained in:
Eric Liu 2022-05-03 19:10:19 -07:00
commit 1353c31642

View file

@ -41,9 +41,12 @@
ctx.declareRef({ key: "selection", ref });
}
$: description = selectionCount
? translateWithId("clearAll")
: translateWithId("clearSelection");
$: translationId = selectionCount
? translationIds.clearAll
: translationIds.clearSelection;
$: description =
translateWithId?.(translationId) ?? defaultTranslations[translationId];
</script>
{#if selectionCount !== undefined}