diff --git a/packages/main/src/Toolbar.ts b/packages/main/src/Toolbar.ts index ee0d39fc8351..7cf7750957e1 100644 --- a/packages/main/src/Toolbar.ts +++ b/packages/main/src/Toolbar.ts @@ -540,7 +540,8 @@ class Toolbar extends UI5Element { getItemsInfo(items: Array) { return items.map((item: ToolbarItem) => { - const ElementClass = getRegisteredToolbarItem(item.constructor.name); + const ctor = item.constructor as typeof ToolbarItem; + const ElementClass = getRegisteredToolbarItem(ctor.getMetadata().getPureTag()); if (!ElementClass) { return null; diff --git a/packages/main/src/ToolbarRegistry.ts b/packages/main/src/ToolbarRegistry.ts index 4d8bcb401b6e..c65d727c345e 100644 --- a/packages/main/src/ToolbarRegistry.ts +++ b/packages/main/src/ToolbarRegistry.ts @@ -5,7 +5,7 @@ import type ToolbarItem from "./ToolbarItem.js"; const registry = getSharedResource>("ToolbarItem.registry", new Map()); const registerToolbarItem = (ElementClass: typeof ToolbarItem) => { - registry.set(ElementClass.name, ElementClass); + registry.set(ElementClass.getMetadata().getPureTag(), ElementClass); }; const getRegisteredToolbarItem = (name: string) => {