Content types: Apply text selection when unlocking alias (#20882)

Added requestAnimationFrame for alias text selection.
This commit is contained in:
Engiber Lozada
2025-11-18 16:17:35 +01:00
committed by GitHub
parent a59476a043
commit e46e65ef22

View File

@@ -113,7 +113,11 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin<string, typeof
}
if (!this._aliasLocked) {
(event.target as UUIInputElement)?.focus();
const input = event.target as UUIInputElement;
input?.focus();
requestAnimationFrame(() => {
input?.select();
});
}
}
@@ -126,7 +130,7 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin<string, typeof
id="name"
placeholder=${ifDefined(this.placeholder)}
label=${nameLabel}
.value=${this.value}
.value=${this.value ?? ''}
@input=${this.#onNameChange}
?required=${this.required}
?readonly=${this.readonly}>