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

Cannot call offsetWidth of undefined #33

Open
toolchild opened this issue May 3, 2018 · 3 comments
Open

Cannot call offsetWidth of undefined #33

toolchild opened this issue May 3, 2018 · 3 comments

Comments

@toolchild
Copy link

Hi,

I use IE11 on Windows 7 and I run it in the IE9 developer mode. When I resize the window I get lots of errors where I try to access a property of undefined.

I do not get the error on IE11 in IE10 developer mode, or any other usual browsers.

Everything seems to be working, just that error is getting spammed into the console.

Since I bundle your code inside a larger app, and the IE doesn't give me the correct line I am not sure whether the folloring is correct:

I believe this is where the error occurs. element seems to be undefined.


/**
 * Check if a `element` is visible in the DOM
 *
 * @param  {Element}  element
 * @return {Boolean}
 */
var isHidden = exports.isHidden = function isHidden(element) {
  return element.offsetWidth === 0 || element.offsetHeight === 0 || element.open === false;
};

Sorry for the bad issue description, but I spent some time trying to find the excact spot or reason, but IE9 devtools just dont work.

@philippkuehn
Copy link

Getting this error in latest Chrome too.

@sidonaldson
Copy link

Still getting this now
@Stryzhevskyi do you need help squashing issues?

@Stryzhevskyi
Copy link
Owner

Stryzhevskyi commented Mar 26, 2019

@sidonaldson, help would be appreciated. But this particular issue seems like detached DOM or something similar (getHiddenParentNodes encounters on undefined).
I've created Issue template, but nobody uses it. Could you make copy of JSFiddle and reproduce error?

And IE 9. Really? Beginning January 12, 2016, only the most current version of Internet Explorer available for a supported operating system will receive technical support and security updates. Lifecycle FAQ—Internet Explorer.

Stryzhevskyi added a commit that referenced this issue Apr 2, 2019
- add version
- expose internal modules (dom, functions)
- fix (?) offsetWidth of undefined #33
- fix Readme
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

No branches or pull requests

4 participants