Wednesday, 31 March 2021

How to display mat-menu after entering 3 characters in input field?

I'm implement this input field so that when I enter 3 characters I want to display mat-menu as a value of mat-option but for some reason the mat-menu never gets display. Can anyone point me in the right direction? thanks a lot in advance!

Here's LIVE DEMO

<mat-autocomplete #auto="matAutocomplete">
    <mat-option *ngIf="isSpinnerLoading">

  <div *ngIf="!menuContent">Loading...</div>
  <div *ngIf="menuContent">
    show menu

    <mat-menu #menu="matMenu" class="menu-select">
            <div (click)="$event.stopPropagation()">
                <div *ngFor="let item of myList">
                    <mat-checkbox
                        class="mat-menu-item">
                        
                    </mat-checkbox>
                </div>
            </div>
        </mat-menu>
  </div>
    </mat-option>
</mat-autocomplete>

This is what I'm trying to accomplish:

enter image description here



from How to display mat-menu after entering 3 characters in input field?

No comments:

Post a Comment