Skip to content

Commit

Permalink
Prevent typing in Public Search Type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Haselhan committed May 29, 2024
1 parent 075a9bf commit 6a737d5
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 6a737d5

Please sign in to comment.