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

dgrid error parentNode is null #1416

Closed
thejedi opened this issue Mar 20, 2018 · 4 comments
Closed

dgrid error parentNode is null #1416

thejedi opened this issue Mar 20, 2018 · 4 comments

Comments

@thejedi
Copy link

thejedi commented Mar 20, 2018

Recently we have upgraded our version of the API to version 1.2.1 and now get this error when clicking on the column header twice in a row when using a REST dstore.

The error comes from line 222 in the OnDemandList.js
if (self._previousScrollPosition && parentNode.offsetHeight) {
// Restore position after a refresh operation w/ keepScrollPosition but only
// if the rows have been inserted into the DOM.
self.scrollTo(self._previousScrollPosition);
delete self._previousScrollPosition;
}

The added check of parentNode.offsetHeight is returning null in some cases. This check was not there is earlier versions and I am not sure why it is there now as it is not used inside the if.

@dylans
Copy link
Contributor

dylans commented Mar 20, 2018

Thanks for the regression report @thejedi . 2ae7437 is when it was added (2 years ago).

@edhager
Copy link
Member

edhager commented Apr 11, 2018

If a node has not been inserted into the DOM or is in a fragment that has not been inserted into the DOM, then offsetHeight will be zero. parentNode.offsetHeight is checking if parentNode is in the DOM or not. I added an additional check for parentNode in that if statement.

@thejedi
Copy link
Author

thejedi commented May 9, 2018

@edhager the error was seen after clicking on the column header of a OnDemandGrid that was using a rest dstore so the DOM has to be rendered. Ideas?

@fkranenburg
Copy link

Setting keepScrollPosition:false prevents this issue. Waiting for a new release where this is fixed in.

msssk pushed a commit that referenced this issue Apr 18, 2020
msssk added a commit that referenced this issue Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants