From 4c7d3e49861116c8b2b8ec555d6b0fd03246c866 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Tue, 18 Oct 2022 00:59:19 +0100 Subject: [PATCH] Fallback to font size slug if name is undefined (#45041) --- packages/components/src/font-size-picker/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/font-size-picker/index.tsx b/packages/components/src/font-size-picker/index.tsx index bc5154801880d2..78158b33f43dbe 100644 --- a/packages/components/src/font-size-picker/index.tsx +++ b/packages/components/src/font-size-picker/index.tsx @@ -139,7 +139,7 @@ const UnforwardedFontSizePicker = ( } // Calculate the `hint` for toggle group control. - let hint = selectedOption.name; + let hint = selectedOption?.name || selectedOption.slug; if ( ! fontSizesContainComplexValues && typeof selectedOption.size === 'string'