ngx-google-places-autocomplete icon indicating copy to clipboard operation
ngx-google-places-autocomplete copied to clipboard

When used with *ngIf, .pac-container DOM element gets duplicated

Open tskweres opened this issue 4 years ago • 0 comments

If you have the ngx-places input inside a tab with *ngIf, navigating back and forth will produce multiple .pac-container elements

I had to write a function to remove them on cleanup:

public checkAndRemoveElement() {
    const ele = document.querySelectorAll('.pac-container');
    for (const e of ele) {
      e.remove();
    }
 }

tskweres avatar Apr 22 '20 02:04 tskweres