diff --git a/src/Explorer/Controls/DynamicList/DynamicListComponent.ts b/src/Explorer/Controls/DynamicList/DynamicListComponent.ts index 4951f7cf3..cc699b4a0 100644 --- a/src/Explorer/Controls/DynamicList/DynamicListComponent.ts +++ b/src/Explorer/Controls/DynamicList/DynamicListComponent.ts @@ -86,6 +86,7 @@ export class DynamicListViewModel extends WaitsForTemplateViewModel { public onRemoveItemKeyPress = (data: any, event: KeyboardEvent, source: any): boolean => { if (event.keyCode === KeyCodes.Enter || event.keyCode === KeyCodes.Space) { this.removeItem(data, event); + (document.querySelector(".dynamicListItem:last-of-type input") as HTMLElement).focus(); event.stopPropagation(); return false; } @@ -94,7 +95,7 @@ export class DynamicListViewModel extends WaitsForTemplateViewModel { public addItem(): void { this.listItems.push({ value: ko.observable("") }); - document.getElementById("uniqueKeyItems").focus(); + (document.querySelector(".dynamicListItem:last-of-type input") as HTMLElement).focus(); } public onAddItemKeyPress = (source: any, event: KeyboardEvent): boolean => {