From 8ddb88af23227c41169b06da06e64f54f916f9d4 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 3 May 2022 18:59:17 -0700 Subject: [PATCH] fix(list-box-menu-icon): use default translations if `translateWithId` is undefined Fixes #1281 --- src/ListBox/ListBoxMenuIcon.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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];