Skip to content

Cannot read property 'getComputedStyle' of undefined #186

@anibali

Description

@anibali

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions