diff --git a/packages/base/src/FeaturesRegistry.ts b/packages/base/src/FeaturesRegistry.ts index ac67a3d30fce..76d764e5af90 100644 --- a/packages/base/src/FeaturesRegistry.ts +++ b/packages/base/src/FeaturesRegistry.ts @@ -37,7 +37,7 @@ const registerComponentFeature = async (name: string, feature: typeof ComponentF notifyForFeatureLoad(name); }; -const getComponentFeature = (name: string): T => { +const getComponentFeature = (name: string): T | undefined => { return componentFeatures.get(name) as T; }; diff --git a/packages/main/src/ColorPalette.ts b/packages/main/src/ColorPalette.ts index 8f02df02ddeb..0cf9f215cb28 100644 --- a/packages/main/src/ColorPalette.ts +++ b/packages/main/src/ColorPalette.ts @@ -207,8 +207,8 @@ class ColorPalette extends UI5Element { if (this.showMoreColors) { const ColorPaletteMoreColorsClass = getComponentFeature("ColorPaletteMoreColors"); - ColorPaletteMoreColorsClass.i18nBundle = ColorPalette.i18nBundle; if (ColorPaletteMoreColorsClass) { + ColorPaletteMoreColorsClass.i18nBundle = ColorPalette.i18nBundle; this.moreColorsFeature = new ColorPaletteMoreColorsClass(); } } diff --git a/packages/main/src/Input.ts b/packages/main/src/Input.ts index 11659693e014..9f729c127fb5 100644 --- a/packages/main/src/Input.ts +++ b/packages/main/src/Input.ts @@ -1263,8 +1263,8 @@ class Input extends UI5Element implements SuggestionComponent, IFormInputElement } const Suggestions = getComponentFeature("InputSuggestions"); - Suggestions.i18nBundle = Input.i18nBundle; if (Suggestions) { + Suggestions.i18nBundle = Input.i18nBundle; this.Suggestions = new Suggestions(this, "suggestionItems", true, false); } }