diff --git a/src/panels/config/category/dialog-category-registry-detail.ts b/src/panels/config/category/dialog-category-registry-detail.ts index 84881e3809..74f89f0bd7 100644 --- a/src/panels/config/category/dialog-category-registry-detail.ts +++ b/src/panels/config/category/dialog-category-registry-detail.ts @@ -34,8 +34,13 @@ class DialogCategoryDetail extends LitElement { ): Promise { this._params = params; this._error = undefined; - this._name = this._params.entry ? this._params.entry.name : ""; - this._icon = this._params.entry?.icon || null; + if (this._params.entry) { + this._name = this._params.entry.name || ""; + this._icon = this._params.entry.icon || null; + } else { + this._name = this._params.suggestedName || ""; + this._icon = null; + } await this.updateComplete; } diff --git a/src/panels/config/category/ha-category-picker.ts b/src/panels/config/category/ha-category-picker.ts index 090b3f89b2..529db65b2c 100644 --- a/src/panels/config/category/ha-category-picker.ts +++ b/src/panels/config/category/ha-category-picker.ts @@ -237,6 +237,7 @@ export class HaCategoryPicker extends SubscribeMixin(LitElement) { showCategoryRegistryDetailDialog(this, { scope: this.scope!, + suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "", createEntry: async (values) => { const category = await createCategoryRegistryEntry( this.hass,