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

_isVisible should check size of scrollTarget #485

Open
MaKleSoft opened this issue Sep 12, 2017 · 0 comments
Open

_isVisible should check size of scrollTarget #485

MaKleSoft opened this issue Sep 12, 2017 · 0 comments

Comments

@MaKleSoft
Copy link

The _isVisible method checks offsetWidth and offsetHeight of the iron-list element to determine if it the list is visible or not. The method is used to determine whether the list should be rendered and to trigger adding/removing the scroll listener, I'm assuming as a performance optimization.

The problem with always checking the iron-list element itself is that if an external scrollTarget is used, the size if the list is not a good indicator for whether it is 'visible'. For example, if the list is empty and not sized explicitly, the iron-list elements height will be 0, which will prevent a render even if the corresponding scrollTarget is visible. I've also had problems with the scroll handler being removed and not added back if the scrollTarget was hidden and shown while the list itself was empty.

The obvious and simple fix is to check the size of the scrollTarget instead of the iron-list element itself. Gonna submit a PR for this soon.

@MaKleSoft MaKleSoft mentioned this issue Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant