I was working on with chips and after setting up horizontal scroll to mat chips i found this issue If you click anywhere on mat chips after scroll down it will automatically scoll up to the top. after testing original code of mat chips on stackblitz i found mat chips have this funcationality but default. I need to prevent this from happening.
Here is my HTML code
> <div class="callTags robotoRegular">
<div class="wrapper">
<div class="box">
<div class="boxWrapper">
<div class="title">
<span class="boxTitle">{{ 'multiWrapupTags.categories.title' | translate}}</span>
</div>
<mat-form-field appearance="none" class="example-chip-list">
<mat-chip-list #chipList1 >
<div class="selectedTags" id="catScroll">
<mat-chip
*ngFor="let category of selectedCategories"
[selectable]="selectable"
[removable]="removable"
(removed)="remove(category, 'category')">
<span >
{{category.Name}}
</span>
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip>
<input
#fruitInput
class="robotoRegular"
[formControl]="categoriesForm"
[matAutocomplete]="auto1"
[matChipInputFor]="chipList1"
(ngModelChange)="change($event, 'category')"
placeholder="Select Category"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="add($event, 'category')">
</div>
<div class="d-flex">
<div class="d-flex flex-column ">
<button id="up"><span class="material-icons"> keyboard_arrow_up </span></button>
<button id="down"><span class="material-icons"> keyboard_arrow_down </span></button>
</div>
<button mat-button (click)="deleteAll('category')">Clear</button>
</div>
</mat-chip-list>
<mat-autocomplete #auto1="matAutocomplete">
<mat-option *ngFor="let category of filteredCategories; let i = index" [value]="category.Name" (click)="selected(category, 'category')">
<div>{{category.Name}}</div>
</mat-option>
</mat-autocomplete>
</mat-form-field>
<div class="count">
<span >{{selectedCategories.length}}</span>
</div>
</div>
</div>
<!-- subCategories -->
<div class="box subCategories">
<div class="boxWrapper">
<div class="title">
<span class="boxTitle">{{ 'multiWrapupTags.subCategories.title' | translate}}</span>
</div>
<mat-form-field appearance="none" class="example-chip-list">
<mat-chip-list #chipList2 aria-label="Fruit selection">
<div class="selectedTags wrapups" id='scrol'>
<mat-chip
*ngFor="let subCat of selectedWrapUps"
[selectable]="selectable"
[removable]="removable"
(removed)="remove(subCat, 'wrapup')">
<span class="
">
{{subCat.Name}}
</span>
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip>
<input
#categoryInput
class="robotoRegular"
[formControl]="subcategoriesForm"
[matAutocomplete]="auto2"
[matChipInputFor]="chipList2"
placeholder="Select Wrapup"
(ngModelChange)="change($event, 'wrapup')"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="add($event, 'wrapup')">
</div>
<div class="d-flex">
<div class="d-flex flex-column ">
<button id="up"><span class="material-icons"> keyboard_arrow_up </span></button>
<button id="down"><span class="material-icons"> keyboard_arrow_down </span></button>
</div>
<button mat-button (click)="deleteAll('wrapup')">Clear</button>
</div>
</mat-chip-list>
<mat-autocomplete #auto2="matAutocomplete">
<mat-option *ngFor="let subCategory of filteredWrapUps" [value]="subCategory.Name" (click) = "selected(subCategory, 'wrapup')">
{{subCategory.Name}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
<div class="count">
<span >{{selectedWrapUps.length}}</span>
</div>
</div>
</div>
<div class="box tagsBox">
<div class="boxWrapper">
<div class="title">
<span class="boxTitle">{{ 'multiWrapupTags.tags.title' | translate}}</span>
</div>
<mat-form-field appearance="none" class="example-chip-list">
<mat-chip-list #chipList3 aria-label="Fruit selection">
<div class="selectedTags">
<mat-chip
*ngFor="let tag of selectedTags"
[selectable]="selectable"
[removable]="removable"
(removed)="remove(tag, 'tags')">
<span class="
">
{{tag.Name}}
</span>
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
</mat-chip>
<input
#fruitInput
class="robotoRegular"
[formControl]="tagsForm"
[matAutocomplete]="auto3"
[matChipInputFor]="chipList3"
placeholder="Select Tag"
(ngModelChange)="change($event, 'tags')"
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
(matChipInputTokenEnd)="add($event, 'tags')">
</div>
<div class="d-flex">
<div class="d-flex flex-column ">
<button id="up"><span class="material-icons"> keyboard_arrow_up </span></button>
<button id="down"><span class="material-icons"> keyboard_arrow_down </span></button>
</div>
<button mat-button (click)="deleteAll('tags')">Clear</button>
</div>
</mat-chip-list>
<mat-autocomplete #auto3="matAutocomplete">
<mat-option *ngFor="let tag of filteredTags" [value]="tag.Name" (click)="selected(tag, 'tags')">
{{tag.Name}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
<div class="count">
<span >{{selectedTags.length}}</span>
</div>
</div>
</div>
<button mat-stroked-button (click)="onCallEnded()" aria-label="Show an example snack-bar">
Success Notification
</button>
</div>
</div>