Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

mat auto complete floating issue

//in HTML
<input
  #autoCompleteInput //it is the selector used in component
  type="text"
  class="form-control"
  matInput
  [matAutocomplete]="auto"
  formControlName="country"
  (input)="filterCountries($event.target.value)"
/>

//in component
@ViewChild('autoCompleteInput', { read: MatAutocompleteTrigger, static: false })
autoComplete: MatAutocompleteTrigger;

ngOnInit(): void {
    window.addEventListener('scroll', this.scrollEvent, true);
}

scrollEvent = (event: any): void => {
    if(this.autoComplete.panelOpen)
      // this.autoComplete.closePanel(); //you can also close the panel 
      this.autoComplete.updatePosition();
};
Comment

PREVIOUS NEXT
Code Example
Typescript :: what is electric potential 
Typescript :: print string odd elements in python 
Typescript :: crashlytics ionic 3 
Typescript :: typescript html input 
Typescript :: hthe cmd to create tsconfig.json 
Typescript :: python requests post set content type 
Typescript :: loaded because running scripts is disabled on this s 
Typescript :: loop through object typescript 
Typescript :: how do i remove the brackets around a list in python 
Typescript :: angular dictionary 
Typescript :: see what ports are in use 
Typescript :: wordpress have_posts not working 
Typescript :: tweepy stream tweets from user 
Typescript :: how to display server count on discord.js 
Typescript :: ERROR: Could not find a version that satisfies the requirement mediapipe (from versions: none) ERROR: No matching distribution found for mediapipe 
Typescript :: function that redirects to another page react 
Typescript :: swalert 2 show loader 
Typescript :: typscript to string 
Typescript :: Please make sure you have the correct access rights and the repository exists. 
Typescript :: typescript remove an item from array 
Typescript :: typescript bigint vs number 
Typescript :: typescript ge t current screen resolution 
Typescript :: react routes not working after build 
Typescript :: linux host file location 
Typescript :: angular jasmine mock http request 
Typescript :: add digits java 
Typescript :: mocha test typescript 
Typescript :: gitlab where are artifacts stored 
Typescript :: find all running ports node 
Typescript :: requirements of fortnite 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =