question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'getComputedStyle' of undefined

See original GitHub issue

Version: react-draggable 2.2.0 Browser: Google Chrome Linux 51.0.2704.106 (64-bit) Error: Cannot read property 'getComputedStyle' of undefined Source of error: https://github.com/mzabriskie/react-draggable/blob/ac269435565fe584f0409345dcb79e8f5b682828/lib/utils/positionFns.es6#L29

Looking a few lines up from the source of the error, I think that changing

const ownerWindow = node.defaultView;

to

const ownerWindow = ownerDocument.defaultView;

might fix the problem. I’ve never used defaultView before though, and I’m not sure what is trying to be achieved with it, so take that with a pinch of salt.

I have no problems with react-draggable 2.1.2.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:9

github_iconTop GitHub Comments

2reactions
grunnlockcommented, Aug 2, 2016

Happens to me as well when using the “bounds” property: <ReactDraggable bounds="body" handle=".dashboard-panel-header" onStart={ @focusPanel } onClick={ @focusPanel } >

1reaction
afilpcommented, Aug 2, 2016

It happens to me too, this is very problematic and I do not know what to do! I would appreciate a quick fix, thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'getComputedStyle' of undefined · Issue ...
when I close or navigate from one page that has a form to another page this error shows: TypeError: Cannot read property 'getComputedStyle' ......
Read more >
Cannot read property 'getComputedStyle' of undefined ckeditor
I found the problem. It was a problem with a jquery plugin mscustomscrollbar. To resolve this I deleted the plugin and used css3...
Read more >
Getting 'getComputedStyle' of undefined an 'select' of null on ...
Uncaught TypeError : Cannot read property 'getComputedStyle' of undefineda.getComputedStyle.Ib @ jquery-1.11.1.min.js:3a.getComputedStyle.
Read more >
Cannot read property 'getComputedStyle' of undefined ckeditor
I use ckeditor on my website, and from time to time when I load my page I get this error which blocks the...
Read more >
How To Fix Cannot Read Property 'style' of Null in JavaScript
This error boils down to one problem. The element you are trying to access does not exist in the DOM (document object model)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found