Ionic2 in iPhone, this.input.nativeElement.click() not work

Click the button does not open the picture selection dialog, click input to open dialog.
It’s working android browser and macbook safari, no working in iPhone
so, the problem about this.inputImgsEl.nativeElement.click();

help me, thank a lot

<input #inputImgs id="inputImgs" class="hidden " type="file"  (change)="uploadImgs($event)" multiple />

<button dark outline clear (click)="selectImgs()">
  <ion-icon name="images"></ion-icon>
</button>
@ViewChild('inputImgs') inputImgsEl;

selectImgs(event) {
  this.inputImgsEl.nativeElement.value = '';
  this.inputImgsEl.nativeElement.click();
}

you can try in http://v2.hey-community.com, after sign up to timeline create

1 Like