From 877173df592e840e4b09fa30c8322e7aa8055d30 Mon Sep 17 00:00:00 2001 From: metonym Date: Tue, 3 May 2022 19:43:07 -0700 Subject: [PATCH] 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 --- src/ListBox/ListBoxMenuIcon.svelte | 4 +++- src/ListBox/ListBoxSelection.svelte | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ListBox/ListBoxMenuIcon.svelte b/src/ListBox/ListBoxMenuIcon.svelte index 0ed8f211..9c68b736 100644 --- a/src/ListBox/ListBoxMenuIcon.svelte +++ b/src/ListBox/ListBoxMenuIcon.svelte @@ -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];
{#if selectionCount !== undefined}