-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle broken image uri #137
Comments
@serfgy thanks for asking your question! There currently is not a way, but perhaps there should be. What do you envision? Accepting callbacks for the |
If the image link is broken or picture is not found, how
https://github.com/mbrevda/react-image/blob/master/src/index.js By the way, awesome work! |
Instinct tells me that if loading the initial image fails, then zooming should be disabled by default. Agree/disagree? Edit: and thanks for the props! |
Yea, the priority is to disable the zoom by default for the broken link case, even if we cant stop the rendering for now. Cheers! |
K I'll schedule some time for this and get back to it soon. Thanks for your submission, and I'll add you to the All Contributors list in the README |
Looking to get on this tomorrow at some point (NZ-time) |
Update: almost done and should have a PR up either tonight or tomorrow |
@rpearce , just tested it, it detects failed images and disables the zoom nicely! I tried removing the timeout and put the src change on the onError instead (on the second image in the storybook) and it also works with no issues:
Cheers! |
Cool. I'll merge it up and notify you when it's published |
@serfgy I've just published |
Is there a way to handle broken image uri? In the event the src value leads to an unavailable image, the broken image pic appears and can be unsightly.
Also, clicking on the broken image pic still zooms in on it.
The text was updated successfully, but these errors were encountered: