I have a form below with multiple elements. One element is an input with a custom directive for getting google location data. The other element is a file upload element.
When I enter in a value (in focus) in the top element and press enter, it triggers 'fileChangeEvent()' event in the #fileInput element.
I'm having a hard time understanding why?
FYI - I tried changing
(change)="fileChangeEvent($event)"
to
(click)="fileChangeEvent($event)"
and it still gets triggered
Form -
<form [formGroup]="editForm">
// pressing enter, with this element in focus, triggers fileChangeEvent($event) in #fileInput element below
<input #city appGooglePlaces (onSelect)="setAddress($event)" formControlName="city" class="form-control google-place-input">
<button (click)="fileInput.click()" class="btn btn-yb w-100">Upload Photo</button>
<input type="file" #fileInput (change)="fileChangeEvent($event)" />
</form>