From 0d031bbc208fa74bb21e46a7c607af33bfb56c0b Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 14 Jul 2022 04:15:55 -0700 Subject: [PATCH] Merge pull request #17430 from huyenltnguyen/fix/toolbars Toolbars: Fall back to name if both title and icon are not specified --- addons/toolbars/src/components/ToolbarMenuList.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/toolbars/src/components/ToolbarMenuList.tsx b/addons/toolbars/src/components/ToolbarMenuList.tsx index ae921689ad89..6b2ad31e984f 100644 --- a/addons/toolbars/src/components/ToolbarMenuList.tsx +++ b/addons/toolbars/src/components/ToolbarMenuList.tsx @@ -38,6 +38,14 @@ export const ToolbarMenuList: FC = withKeyboardCycle( // Deprecation support for old "name of global arg used as title" if (showName && !title) { title = name; + console.warn( + '`showName` is deprecated as `name` will stop having dual purposes in the future. Please specify a `title` in `globalTypes` instead.' + ); + } else if (!showName && !icon && !title) { + title = name; + console.warn( + `Using the \`name\` "${name}" as toolbar title for backward compatibility. \`name\` will stop having dual purposes in the future. Please specify either a \`title\` or an \`icon\` in \`globalTypes\` instead.` + ); } if (dynamicTitle) {