Content types: Apply text selection when unlocking alias (#20882)
Added requestAnimationFrame for alias text selection.
This commit is contained in:
@@ -113,7 +113,11 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin<string, typeof
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this._aliasLocked) {
|
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"
|
id="name"
|
||||||
placeholder=${ifDefined(this.placeholder)}
|
placeholder=${ifDefined(this.placeholder)}
|
||||||
label=${nameLabel}
|
label=${nameLabel}
|
||||||
.value=${this.value}
|
.value=${this.value ?? ''}
|
||||||
@input=${this.#onNameChange}
|
@input=${this.#onNameChange}
|
||||||
?required=${this.required}
|
?required=${this.required}
|
||||||
?readonly=${this.readonly}>
|
?readonly=${this.readonly}>
|
||||||
|
|||||||
Reference in New Issue
Block a user