From 15ac017a659e67f7aa3a15413ac4a696daa88c2b Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Mon, 17 Oct 2022 16:10:45 +0100 Subject: [PATCH] Fallback to font size slug if name is undefined --- 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 bc5154801880d..78158b33f43db 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'