Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70433

Ionic 4/5 issue with ion-slide and modal

$
0
0

@Pratikjaiswa15 wrote:

I am trying to show an image preview using ion-slide inside the ion-modal. But zoom functionality is not working. I have added slideOptions. But not working. Subsequently, the zoom functionality is working with the normal page.

Second issue backdropDismiss : true not closing modal when the backdrop is clicked

here is the code

page.html

<ion-slides [options]="slideOpts">
    <ion-slide *ngFor="let p of products">
          <img [src] = 'p.image_url' tappable (click)="openPreview(p.image_url)">
    
     </ion-slide>
 </ion-slides>

page.ts

async openPreview(image_url){
    console.log(image_url)

    const modal = await this.modalController.create({
      component: ImageModalPage,
      showBackdrop:true,
      backdropDismiss: true,
      componentProps: {
        image_url : image_url,
      },
    });
    return await modal.present();

  }

modal.html

<ion-item class="close-fake" lines="none" text-center>
    <ion-button (click)="close()" fill="clear" color="light">
      <ion-icon name="close" slot="start"></ion-icon>
      back
    </ion-button>

    <ion-slides [options]="sliderOpts">
        <ion-slide>
          <div class="swiper-zoom-container">
            <img [src] ='image_url'>
          </div>
        </ion-slide>
      </ion-slides>

modal.ts

sliderOpts = {
        zoom: {
          maxRatio: 5,
        }
      }

close(){
    this.modalController.dismiss()
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70433

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>