ngx-google-places-autocomplete
ngx-google-places-autocomplete copied to clipboard
reset() not working.
I want to reset the value in the input, but when I do it gives an error "InvalidValueError: setTypes not an Array". It does not reset any values on the input (I check the values before and after the reset action and they are the same).
Problem recreated on this StackBlitz. https://stackblitz.com/edit/angular-eczgx5
I have the same problem as you and it does seem to be a bug. In the meantime, here is a workaround if needed:
HTML:
<input #addressInput ngx-google-places-autocomplete #placesRef="ngx-places"
(onAddressChange)="handleAddressChange($event)" />
TS:
import { ElementRef, ViewChild } from '@angular/core';
@ViewChild('addressInput') private addressInput: ElementRef;
public resetInput(): void {
const input = this.addressInput.nativeElement as HTMLInputElement;
input.value = '';
}
hi @fliebenberg , There is an error in your example "ERROR ReferenceError: google is not defined". Probably it can be the root cause of the issue. I don't have such a problem with my local machine