From 5f895c134c434a295ac7eeb387b3dbf953a96ff6 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.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/font-size-picker/index.js b/packages/components/src/font-size-picker/index.js index 1fb266bba02b2b..47668eb2dca161 100644 --- a/packages/components/src/font-size-picker/index.js +++ b/packages/components/src/font-size-picker/index.js @@ -116,7 +116,7 @@ function FontSizePicker( } // Calculate the `hint` for toggle group control. - let hint = selectedOption.name; + let hint = selectedOption?.name || selectedOption.slug; if ( ! fontSizesContainComplexValues && typeof selectedOption.size === 'string'