diff --git a/ts/editor-toolbar/helpers.ts b/ts/editor-toolbar/helpers.ts index cb33d3c7f..039e5919d 100644 --- a/ts/editor-toolbar/helpers.ts +++ b/ts/editor-toolbar/helpers.ts @@ -4,6 +4,10 @@ export function mergeTooltipAndShortcut( tooltip: string | undefined, shortcutLabel: string | undefined ): string | undefined { + if (!tooltip && !shortcutLabel) { + return undefined; + } + let buf = tooltip ?? ""; if (shortcutLabel) { buf = `${buf} (${shortcutLabel})`;