Item pane scroll height only grows, never shrinks, leading to blank scroll areas
Hi! I'm contributing to Cita (https://github.com/diegodlh/zotero-cita/pull/300), an add-on to download, manage and sync citations. They're displayed in a custom item pane section, in the same style as related items. Hence, when there are many citations (references), the item pane needs to scroll. It appears that the scroll height is updated whenever needed, increasing the minimum scroll height accordingly. However, the code (https://github.com/zotero/zotero/blob/dc47650eb353a389dd01c20102ad5f4bbca7758b/chrome/content/zotero/elements/itemDetails.js#L543) and testing shows that it only updates that minimum scroll height to bigger values, not smaller ones.
In other words, if we navigate to an item with few citations (not much to scroll through), the scroll height is adequate. If we navigate to an item with many citations, the scroll height adapts accordingly (lots to scroll through). However, when navigating back to an item with few citations, the calculated scroll height is lower than the currently set minimum, so the previous scroll height is kept, leading to a scroll height that is much larger than needed, and thus lots of (empty) space to scroll through.
I believe this could be tested with items with many related items vs few related items.
In other words, if we navigate to an item with few citations (not much to scroll through), the scroll height is adequate. If we navigate to an item with many citations, the scroll height adapts accordingly (lots to scroll through). However, when navigating back to an item with few citations, the calculated scroll height is lower than the currently set minimum, so the previous scroll height is kept, leading to a scroll height that is much larger than needed, and thus lots of (empty) space to scroll through.
I believe this could be tested with items with many related items vs few related items.
-
thebluepotatoFor context, this happens when the very last section pane is pinned and other section panes above are very long