ngx-ionic-image-viewer icon indicating copy to clipboard operation
ngx-ionic-image-viewer copied to clipboard

[bug]: The first instance of a image doesn't zoom, but after close it, all works ok.

Open Jhonnymv opened this issue 5 years ago • 1 comments

Hi! I hope you're having a good day.

I have a problem with the first time open a image. I can't zoom it and if i drag it, it drags to right or left. But when i close that first image and open it again, all works ok, the image can zoom and already it doesn't let me drag and stay it in the middle as it should be.

This is my code

<ion-slides scrollbar="true">
                <ion-slide>
                    <ion-img ionImgViewer class="image" src="{{'https://umbrella.com/apiExample'+img1.substring(1)}}" scheme="dark"></ion-img>
                </ion-slide>
            
                <ion-slide>
                    <ion-img ionImgViewer class="image" src="{{'https://umbrella.com/apiExample'+img2.substring(1)}}" scheme="dark"></ion-img>
                </ion-slide>
          </ion-slides>

And this is what's happening:

Screenshot_1 Screenshot_2

If I leave the cursor pressed, the image stays where I dragged it. But as i said, when close the image, and open it again, all works good.

I don't know, maybe it just happens to me.

Thanks!!!

Jhonnymv avatar Aug 21 '20 23:08 Jhonnymv

I believe this bug is caused by having multiple Swiper instances on the same page. If you remove the ion-slides element, the bug will no longer exist. However, I have not found the solution yet.

seanwu1105 avatar Feb 17 '21 07:02 seanwu1105