Comments (7)
Hi @selected-pixel-jameson, in your case you create a new modal without any reference to your <ion-img />
child. The src
attribute is always required. Try this:
componentProps: {
src: this.item.imageUrl,
}
You know you can also use the directive
of the ngx-ionic-image-viewer
which solve your case directly?
<ion-img ionImgViewer [title]="item.title" [src]="item.thumbnail" [srcHighRes]="item.imageUrl"></ion-img>
from ngx-ionic-image-viewer.
Hi @SimonGolms Adding src to the componentProps doesn't help. I can't use the directive on because this is wrapped inside another element that is clickable and I need to cancel the event propagation via event.stopPropogation()
async presentImage() {
event.stopPropagation();
const modal = await this.modalController.create({
component: ViewerModalComponent,
componentProps: {
src: this.item.imageUrl,
},
cssClass: "ion-img-viewer",
keyboardClose: true,
showBackdrop: true,
});
return await modal.present();
}
Still the same issue. I just see a black screen. if I click anywhere on the screen the image will then show up. But it will not show up when loading.
from ngx-ionic-image-viewer.
As I stated, this works fine when I reference the same image URL that is being loaded in the list view of items. If I change that list to load the imageUrl instead of the the thumbnail url then the imageUrl will load fine as well, but this is not optimal as the image referenced in the imageUrl is much larger.
from ngx-ionic-image-viewer.
Also, if I set this up to load a completely different image, but that image is referenced locally from the assets folder it works fine. It's only an issue when loading a remote image that hasn't been cached yet.
from ngx-ionic-image-viewer.
Oh great... so this only appears to be happening on Android devices and when using the pixel 2 device in chrome dev.
from ngx-ionic-image-viewer.
Looks like it is a bug with Android or Ionic... I had to add this to get it to work.
img{
min-height: 1px !important;
}
ionic-team/ionic-framework#18734
from ngx-ionic-image-viewer.
Thanks for your message and the recent workaround for Android @selected-pixel-jameson.
from ngx-ionic-image-viewer.
Related Issues (20)
- [bug]: Double tap zoom not working after exiting viewer (x) and entering it once again HOT 2
- Title and Text Font Size HOT 1
- [feat]: slide through multiple images HOT 6
- [bug]: Local image by a variable is not shown
- innerHTML HOT 1
- [bug]: srcFallback not working on Controller(ViewerModalComponent) HOT 1
- [bug]: Image doesn't gets close on click ob back button in android. HOT 1
- [support]: Can't bind to 'size' since it isn't a known property of 'ion-title'. HOT 2
- [feat]: Zoom without click on the image HOT 2
- [feat]: Customize back button HOT 3
- [bug]: The first instance of a image doesn't zoom, but after close it, all works ok. HOT 1
- Update Dependences issue
- [feat]: Support for Ionic 5 (peer dep missing) HOT 1
- [bug]: Cannot build with strict mode
- [feat]: Lazy loading the source image
- Modal Close Causes Local app modal close and freezing HOT 1
- [bug]: while clicking on image modal controller is not getting open, nor it is giving any error. HOT 2
- [bug]: Mobile scroll stops working after dismissing ViewerModalComponent HOT 5
- Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.[bug]:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-ionic-image-viewer.