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

fix getElementsByTagName error #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

element6
Copy link

closes #35
closes #23

The initialization should be done once to avoid referencing the wrong function. In this case `options.getThumbBoundsFn = options.getThumbBoundsFn || getThumbBoundsFn;` was referencing the previous getThumbBoundsFn.
@Yuripetusko
Copy link

@minhtranite please merge

@toxsick
Copy link

toxsick commented Feb 7, 2018

This is also a problem for us! Merging would be nice.

regards

@@ -44,22 +53,13 @@ class PhotoSwipeGallery extends React.Component {
}
};

showPhotoSwipe = itemIndex => (e) => {
showPhotoSwipe = index => (e) => {
console.log('click photo')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console usage

state = {
isOpen: this.props.isOpen,
options: this.props.options
options: this.props.options || this.getThumbBoundsFn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this.props.options is undefined, state.options will be a function instead of an object?

@element6
Copy link
Author

@tzachyrm good point! Looking at it now, I am not sure why I did that.

@tzachyrm
Copy link

@minhtranite can you please merge this?

@huhassan
Copy link

huhassan commented Sep 3, 2019

For some reason it doesn't fix the mentioned issue.
Uncaught TypeError: Cannot read property 'getElementsByTagName' of null

There's another fork of this branch at vildehav/react-photoswipe and it solves the issue for me. It's also available on npm.
npm i @dlab/react-photoswipe

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.

Can't take getElementsByTagName() of null. Wtf? Cannot read property 'getElementsByTagName' of null
5 participants