From a0e5aa82529fbe536445de2768776d7f9fb93cec Mon Sep 17 00:00:00 2001 From: JesmoDev <26099018+JesmoDev@users.noreply.github.com> Date: Mon, 20 May 2024 16:12:36 +0200 Subject: [PATCH] use generateAlias util --- .../property-editor-ui-image-crops-configuration.element.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts index 4c6bc54590..524f90c410 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.element.ts @@ -3,6 +3,7 @@ import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor'; +import { generateAlias } from '@umbraco-cms/backoffice/utils'; export type UmbCrop = { label: string; @@ -110,13 +111,13 @@ export class UmbPropertyEditorUIImageCropsConfigurationElement #onLabelInput() { const value = this._labelInput.value ?? ''; - const aliasValue = value.toLowerCase().replace(/[^a-z0-9]/g, '-'); + const aliasValue = generateAlias(value); const alias = this.shadowRoot?.querySelector('#alias') as HTMLInputElement; if (!alias) return; - const oldAliasValue = this.#oldInputValue.toLocaleLowerCase().replace(/[^a-z0-9]/g, '-'); + const oldAliasValue = generateAlias(this.#oldInputValue); if (alias.value === oldAliasValue || !alias.value) { alias.value = aliasValue;