Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

getSize() throws error on getBoundingClientRect #20

@don-p

Description

@don-p

Seems related to:
#9

I see this error when resizing the browser window, in a view that contains a second instance of Splitter:

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null
    at Splitter._this.getSize (Splitter.js:205)

From what I can see, this may be a problem with multiple instances of the Splitter object in one application. For example, in my application I have two main tabs which each contain a Splitter. I see that the Splitter.componentDidMount adds a window resize event listener, that calls _this.getSize. It seems to me that this could cause a problem, since only the currently-rendered object should be responding to window.resize events.

And, a non-rendered Splitter object will have a null reference to its paneWrapper property -

      ref: function ref(node) {
        return _this.paneWrapper = node;
      }

@martinnov92 Have you tested this component in a case like this, with two instances of Splitter in visible and hidden parent tabs?

Thanks,
Don

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