mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix: use default values if translateWithId
is falsy (#1282)
* fix(list-box-menu-icon): use default translations if `translateWithId` is undefined * fix(list-box-selection): use default translations if `translateWithId` is undefined
This commit is contained in:
parent
39e3424b6f
commit
877173df59
2 changed files with 9 additions and 4 deletions
|
@ -22,7 +22,9 @@
|
|||
[translationIds.open]: "Open menu",
|
||||
};
|
||||
|
||||
$: description = open ? translateWithId("close") : translateWithId("open");
|
||||
$: translationId = open ? translationIds.close : translationIds.open;
|
||||
$: description =
|
||||
translateWithId?.(translationId) ?? defaultTranslations[translationId];
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue