mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue