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 }); ctx.declareRef({ key: "selection", ref });
} }
$: description = selectionCount $: translationId = selectionCount
? translateWithId("clearAll") ? translationIds.clearAll
: translateWithId("clearSelection"); : translationIds.clearSelection;
$: description =
translateWithId?.(translationId) ?? defaultTranslations[translationId];
</script> </script>
{#if selectionCount !== undefined} {#if selectionCount !== undefined}