Skip to content
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

fixes #389 #390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fixes #389 #390

wants to merge 1 commit into from

Conversation

saas786
Copy link

@saas786 saas786 commented Jun 3, 2024

Upon troubleshooting, it was found that when an image throws an error, this inside the callback refers to the image element and not the JustifiedGallery instance. This causes a TypeError because this.resetImgSrc is not a function in the context of the image element.

To resolve this, I ensured that this correctly refers to the JustifiedGallery instance by using .bind(this) on the callback function.

Also might help resolve: #333, #351

Upon troubleshooting, it was found that when an image throws an error, this inside the callback refers to the image element and not the JustifiedGallery instance. This causes a TypeError because this.resetImgSrc is not a function in the context of the image element.

To resolve this, I ensured that this correctly refers to the JustifiedGallery instance by using .bind(this) on the callback function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test remote_imgs_waitThumbsLoad_callbacks.html throws 'this.resetImgSrc is not a function'
1 participant