diff --git a/src/panels/lovelace/create-element/create-element-base.ts b/src/panels/lovelace/create-element/create-element-base.ts index 8a1482e43e..4556efe509 100644 --- a/src/panels/lovelace/create-element/create-element-base.ts +++ b/src/panels/lovelace/create-element/create-element-base.ts @@ -154,7 +154,7 @@ const _lazyCreate = ( const _getCustomTag = (type: string) => type.startsWith(CUSTOM_TYPE_PREFIX) - ? type.substr(CUSTOM_TYPE_PREFIX.length) + ? type.slice(CUSTOM_TYPE_PREFIX.length) : undefined; export const createLovelaceElement = ( diff --git a/src/panels/lovelace/editor/get-card-documentation-url.ts b/src/panels/lovelace/editor/get-card-documentation-url.ts index e810f6bb4f..7d01eb9419 100644 --- a/src/panels/lovelace/editor/get-card-documentation-url.ts +++ b/src/panels/lovelace/editor/get-card-documentation-url.ts @@ -10,7 +10,8 @@ export const getCardDocumentationURL = ( type: string ): string | undefined => { if (type.startsWith(CUSTOM_TYPE_PREFIX)) { - return getCustomCardEntry(type)?.documentationURL; + return getCustomCardEntry(type.slice(CUSTOM_TYPE_PREFIX.length)) + ?.documentationURL; } return `${documentationUrl(hass, "/lovelace/")}${type}`;