ionic-img-viewer icon indicating copy to clipboard operation
ionic-img-viewer copied to clipboard

TypeError: imageElement.getBoundingClientRect is not a function

Open chrisgeek opened this issue 7 years ago • 6 comments
trafficstars

Please provide you version information :

Dependency Version
ionic 3.9.2
angular 5.0.1
ionic-img-viewer 2.9.0
I get this error when using ion-img tag and not img.
It works perfectly when using img tag only.

chrisgeek avatar Jan 20 '18 20:01 chrisgeek

I have the same issue.

BobaFett58 avatar Jan 26 '18 15:01 BobaFett58

I had to use a popover to get the zoom effect.

chrisgeek avatar Jan 26 '18 20:01 chrisgeek

Same here.

devfelipereis avatar May 14 '18 14:05 devfelipereis

Any solution for this ?

SnehaSSD avatar Jun 21 '18 08:06 SnehaSSD

I believe this happens if you don't pass the necessary object or set the #

Try the following:

html <img src="youtimageurl.png" #imageToView (click)="openImage(imageToView)"/>

ts openImage(imageToView){ const viewer = this.imageViewerCtrl.create(imageToView, {fullResImage: fullSizePicture}) viewer.present(); }

You can remove ", {fullResImage: fullSizePicture}" if you are not loading a different fullsize image

kevingrabher avatar Jun 26 '18 13:06 kevingrabher

this can be solved by doing this if u are using ion-img tag <ion-img src="cat.png" imageViewer="cat.png"></ion-img>

hitmacreed avatar Nov 13 '18 16:11 hitmacreed