Skip to content

Commit

Permalink
Merge pull request #1724 from bcgov/feature/ALCS-1995
Browse files Browse the repository at this point in the history
Prevent typing in Public Search Type filter
  • Loading branch information
dhaselhan authored May 29, 2024
2 parents 075a9bf + 6a737d5 commit 41614ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
id="type"
type="text"
matInput
(input)="filterChanged($event)"
[matAutocomplete]="auto"
[formControl]="componentTypeControl"
(blur)="onBlur()"
onkeydown="return false;"
/>
<mat-icon class="dropdown-arrow" matSuffix>arrow_drop_down</mat-icon>
<button class="clear-button" *ngIf="componentTypeControl.value?.length" matSuffix mat-icon-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class FileTypeFilterDropDownComponent implements AfterViewInit {
this.populateSelectedItems();
}

constructor(private fileTypeData: FileTypeDataSourceService) {
constructor(fileTypeData: FileTypeDataSourceService) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel, this.isExpandable, this.getChildren);
this.treeControl = new FlatTreeControl<FlatTreeNode>(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
Expand Down Expand Up @@ -161,18 +161,6 @@ export class FileTypeFilterDropDownComponent implements AfterViewInit {
this.componentTypeControl.setValue(selectedItems);
}

filterChanged($event: any) {
const filterText = $event.target.value;
// FileTypeTreeComponent.filter method which actually filters the tree and gives back a tree structure

this.fileTypeData.filter(filterText);
if (filterText) {
this.treeControl.expandAll();
} else {
this.treeControl.collapseAll();
}
}

onChange() {
this.fileTypeChange.emit(
this.checklistSelection.selected
Expand All @@ -190,9 +178,4 @@ export class FileTypeFilterDropDownComponent implements AfterViewInit {
ngAfterViewInit(): void {
this.treeControl.expandAll();
}

onBlur() {
this.populateSelectedItems();
this.fileTypeData.filter('');
}
}

0 comments on commit 41614ed

Please sign in to comment.