Prevent close button 'stealing' focus from modal input fields

This commit is contained in:
Michael Shamoon
2021-01-16 14:09:23 -08:00
parent b3004dc690
commit 2b8dcc21cc
6 changed files with 18 additions and 6 deletions

View File

@@ -27,6 +27,8 @@ export abstract class EditDialogComponent<T extends ObjectWithId> implements OnI
networkActive = false
closeEnabled = false
error = null
abstract getForm(): FormGroup
@@ -37,6 +39,11 @@ export abstract class EditDialogComponent<T extends ObjectWithId> implements OnI
if (this.object != null) {
this.objectForm.patchValue(this.object)
}
// we wait to enable the close button so it doesnt pull browser focus since its the first clickable element in the DOM
setTimeout(() => {
this.closeEnabled = true
});
}
getCreateTitle() {