Skip to content

Commit

Permalink
validate request form: set focus in search input
Browse files Browse the repository at this point in the history
* Sets focus in search input after validation.
* Closes rero/rero-ils#803.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger authored and AoNoOokami committed Mar 3, 2020
1 parent 3c26950 commit 59c0797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
[placeholder]="placeholder | translate"
[searchText]="searchText"
(search)="searchValueUpdated($event)"
[focus]="searchInputFocus"
></ng-core-search-input>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class MainRequestComponent implements OnInit {
private libraryPid: string;
public isLoading = false;

/** Focus attribute of the search input */
searchInputFocus = false;

/** Constructor
* @param userService: User Service
* @param itemsService: Items Service
Expand All @@ -55,6 +58,7 @@ export class MainRequestComponent implements OnInit {
this.items = null;
this.getRequestedLoans();
}
this.searchInputFocus = true;
}

getRequestedLoans() {
Expand Down Expand Up @@ -95,5 +99,6 @@ export class MainRequestComponent implements OnInit {
}
);
}
this.searchInputFocus = true;
}
}

0 comments on commit 59c0797

Please sign in to comment.