griffithlab / civic-v2

CIViC is an open access, open source, community-driven web resource for Clinical Interpretation of Variants in Cancer
https://civicdb.org
MIT License
19 stars 5 forks source link

table virtual scroll does not work in some situations #1062

Open jmcmichael opened 2 months ago

jmcmichael commented 2 months ago

Entity tables virtual scroll feature will not trigger a fetch request if the table body is tall enough such that the initial row query does not sufficiently populate its full height with rows. The virtual scroll code fetch request is only triggered when its rendered rows container approaches the bottom of the displayed rows container. Its logic assumes that the rendered row container will be larger than the displayed row container, and won't trigger if that is not the case.

This could be fixed by adding an additional check in one of the later Angular lifecycle hooks, to check these container heights after the initial query has rendered its rows, and issue an additional fetch more query if the rendered row container is shorter than the displayed rows container.

A quick fix would be to increase the count of each table's initial loaded rows from 25 to a quantity that will ensure enough rows are populated even for very tall tables.

This can be tested by using the browser zoom feature to zoom out enough such that the tables will display more than 25 rows.