Skip to content

Commit

Permalink
[ACA-2053] Create folder - focus on first form input (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
pionnegru authored and DenysVuika committed Dec 7, 2018
1 parent c7d11b9 commit e1133eb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/services/content-management.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ export class ContentManagementService {
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 => {
if (node) {
this.folderCreated.next(node);
Expand All @@ -259,6 +266,13 @@ export class ContentManagementService {
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) => {
if (node) {
this.folderEdited.next(node);
Expand Down

0 comments on commit e1133eb

Please sign in to comment.