[ACA-2075] Create Library dialog is not focused when opening it for the second time (#863)

* remove autofocus property

* let dialog focus elements

* remove autoFocus dialog configs

* autoFocus default config
This commit is contained in:
Cilibiu Bogdan 2018-12-07 18:12:15 +02:00 committed by Denys Vuika
parent 904c08461d
commit ec3eeb7a63
3 changed files with 1 additions and 16 deletions

View File

@ -6,7 +6,6 @@
<input <input
placeholder="{{ 'LIBRARY.DIALOG.FORM.NAME' | translate }}" placeholder="{{ 'LIBRARY.DIALOG.FORM.NAME' | translate }}"
required required
autofocus
matInput matInput
formControlName="title" formControlName="title"
autocomplete="off" autocomplete="off"

View File

@ -57,7 +57,7 @@ import {
providers: [ providers: [
{ {
provide: MAT_DIALOG_DEFAULT_OPTIONS, provide: MAT_DIALOG_DEFAULT_OPTIONS,
useValue: { closeOnNavigation: true, hasBackdrop: true } useValue: { closeOnNavigation: true, hasBackdrop: true, autoFocus: true }
} }
] ]
}) })

View File

@ -236,13 +236,6 @@ export class ContentManagementService {
this.store.dispatch(new SnackbarErrorAction(message)); this.store.dispatch(new SnackbarErrorAction(message));
}); });
// todo: add focus in ADF component
dialogInstance
.afterOpened()
.subscribe(() =>
(<HTMLElement>document.querySelector('#adf-folder-name-input')).focus()
);
dialogInstance.afterClosed().subscribe(node => { dialogInstance.afterClosed().subscribe(node => {
if (node) { if (node) {
this.folderCreated.next(node); this.folderCreated.next(node);
@ -266,13 +259,6 @@ export class ContentManagementService {
this.store.dispatch(new SnackbarErrorAction(message)); this.store.dispatch(new SnackbarErrorAction(message));
}); });
// todo: add focus in ADF component
dialog
.afterOpened()
.subscribe(() =>
(<HTMLElement>document.querySelector('#adf-folder-name-input')).focus()
);
dialog.afterClosed().subscribe((node: MinimalNodeEntryEntity) => { dialog.afterClosed().subscribe((node: MinimalNodeEntryEntity) => {
if (node) { if (node) {
this.folderEdited.next(node); this.folderEdited.next(node);