Skip to content

TypeError: Cannot read property 'getBoundingClientRect' of null #146

@darthzeran

Description

@darthzeran

I am still investigating whether or not my code caused this, but it seems that there is never a check to prevent node from being null

 var node = _this.slider;
      var coordinateStyle = constants.orientation[orientation].coordinate;
      var directionStyle = reverse ? constants.orientation[orientation].reverseDirection : constants.orientation[orientation].direction;
      var clientCoordinateStyle = 'client' + (0, _utils.capitalize)(coordinateStyle);
      var coordinate = !e.touches ? e[clientCoordinateStyle] : e.touches[0][clientCoordinateStyle];
      var direction = node.getBoundingClientRect()[directionStyle];

Is this expected behavior from rangeslider?

I have successfully recreated my error, as it only happens when my react component disappears (because it gets turned off and gets replaced). Is there a way I can prevent this error from happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions