Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

[bug]: srcFallback not working on Controller(ViewerModalComponent) #28

Closed
javierjsp opened this issue Apr 20, 2020 · 1 comment
Closed

Comments

@javierjsp
Copy link

Bug Report

Ionic version:

[x] 4.x

Current behavior:

Hi, using the Controller Feature with modalController i set srcFallback so when i set src to null or just empty string (trying to reproduce fail behaviour) the fallback its no loading the backup image, So I tested on the Stackblitz demo and the same.

Expected behavior:

srcFallback on ModalController set the image when src fails

Steps to reproduce:

Just overwrite on stackblitz demo (https://stackblitz.com/github/SimonGolms/ngx-ionic-image-viewer/tree/master/demo) with this:

  async openViewer() {
    const modal = await this.modalController.create({
      component: ViewerModalComponent,
      componentProps: {
        src: '', // required <--- here just null or empty
        srcFallBack: 'https://i.picsum.photos/id/237/200/200.jpg',
        title: 'Silhoutte (Programmatic)', // optional
        text: 'Photo by Mayur Gala on Unsplash' // optional
      },
      cssClass: 'ion-img-viewer', // required
      keyboardClose: true,
      showBackdrop: true
    });

    return await modal.present();
  }

Then Open the Modal With the Button at the bottom of the demo.

When I test like this working fine

  <ion-img-viewer
      title="Silhoutte (Scheme / Light)"
      text="Photo by Mayur Gala on Unsplash"
      [src]=""
      [srcFallback]="'https://i.picsum.photos/id/1040/200/200.jpg'"
    ></ion-img-viewer>

Related code:

 Just use the same stackblitz demo
 (https://stackblitz.com/github/SimonGolms/ngx-ionic-image-viewer/tree/master/demo)

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 6.5.0 (C:\Users\orion\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.0, (and 12 other plugins)

Utility:

   cordova-res (update available: 0.12.1) : 0.11.0
   native-run                             : 1.0.0

System:

   Android SDK Tools : 26.1.1 (C:\Users\orion\AppData\Local\Android\Sdk)
   NodeJS            : v10.18.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.13.4
   OS                : Windows 10

@SimonGolms
Copy link
Owner

Hi @javierjsp , thanks for opening the bug. I'll take a look at it the next day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@SimonGolms @javierjsp and others