diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/multiple-text-string/property-editor-ui-multiple-text-string.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/multiple-text-string/property-editor-ui-multiple-text-string.element.ts index ed54c8c915..06f01497f0 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/multiple-text-string/property-editor-ui-multiple-text-string.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/multiple-text-string/property-editor-ui-multiple-text-string.element.ts @@ -67,6 +67,7 @@ export class UmbPropertyEditorUIMultipleTextStringElement extends LitElement { private _onAdd() { this._value = [...this._value, { value: '' }]; this.dispatchEvent(new UmbPropertyValueChangeEvent()); + this._focusNewItem(); } private _onInput(event: UUIInputEvent) { @@ -77,6 +78,13 @@ export class UmbPropertyEditorUIMultipleTextStringElement extends LitElement { this.dispatchEvent(new UmbPropertyValueChangeEvent()); } + private async _focusNewItem() { + await this.updateComplete; + const inputs = this.shadowRoot?.querySelectorAll('uui-input') as NodeListOf; + const lastInput = inputs[inputs.length - 1]; + lastInput.focus(); + } + render() { return html` ${this._renderItems()}