Skip to content

Commit

Permalink
focus search box after adding/removing a user from a team (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aschlackman authored Mar 15, 2024
1 parent 43ceea9 commit ba36a10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[(ngModel)]="filterString"
(keyup)="applyFilter($event.target.value)"
placeholder="Search"
#searchBox
/>
<button
*ngIf="filterString !== ''"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
import { LegacyPageEvent as PageEvent, MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator';
import {
LegacyPageEvent as PageEvent,
MatLegacyPaginator as MatPaginator,
} from '@angular/material/legacy-paginator';
import { MatSort, MatSortable } from '@angular/material/sort';
import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table';
import {
Expand Down Expand Up @@ -56,7 +59,7 @@ export class AddRemoveUsersDialogComponent implements OnInit {

public roles: Array<Role>;

@ViewChild('usersInput') usersInput: ElementRef<HTMLInputElement>;
@ViewChild('searchBox') searchBox: ElementRef<HTMLInputElement>;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@ViewChild(MatSort, { static: true }) sort: MatSort;

Expand Down Expand Up @@ -234,6 +237,7 @@ export class AddRemoveUsersDialogComponent implements OnInit {
this.userDataSource.sort = this.sort;
this.userDataSource.paginator = this.paginator;
this.applyFilter('');
this.searchBox.nativeElement.focus();
this.isBusy = false;
});
});
Expand Down Expand Up @@ -265,6 +269,7 @@ export class AddRemoveUsersDialogComponent implements OnInit {
this.userDataSource.sort = this.sort;
this.userDataSource.paginator = this.paginator;
this.applyFilter('');
this.searchBox.nativeElement.focus();
this.isBusy = false;
});
}
Expand Down

0 comments on commit ba36a10

Please sign in to comment.