Move focus to RenameTabModalComponent onInit

This commit is contained in:
Austin Warren 2018-12-18 17:19:41 -08:00
parent 6b823d0fa0
commit fcf14eaa8b
2 changed files with 1 additions and 4 deletions

View file

@ -16,6 +16,7 @@ export class RenameTabModalComponent {
ngOnInit () {
setTimeout(() => {
this.input.nativeElement.focus()
this.input.nativeElement.select()
}, 250)
}

View file

@ -63,10 +63,6 @@ export class TabHeaderComponent {
showRenameTabModal (): void {
let modal = this.ngbModal.open(RenameTabModalComponent)
modal.componentInstance.value = this.tab.customTitle || this.tab.title
setTimeout(() => {
const inputElement = modal.componentInstance.input.nativeElement as HTMLInputElement
inputElement.select()
}, 250)
modal.result.then(result => {
this.tab.setTitle(result)
this.tab.customTitle = result