Open rorycl opened 7 months ago
I'm not sure but it seems that in updatePatingation
only the delegate's height is included in the height calculation, rather than each item's height including styling.
See list.go
m.Paginator.PerPage = max(1, availHeight/(m.delegate.Height()+m.delegate.Spacing()))
Perhaps this can only be calculated correctly (particularly with my inconsistently padded example above) by iterating through the items to calculate the sum of heights. delegate.Height()
also does not seem to report heights resulting from lipgloss style heights. Perhaps a delegate.HeightWithStyle()
function would be useful?
Describe the bug Adding padding to items in a list pushes the listing panel up into the filter/status area. I'd expect padding to instead push the list down from the top of the pagination panel. This issue also affects lists utilizing custom list delegates.
Setup My environment:
To Reproduce Add padding to the Title elements.
Source Code Add the following to the bubbletea list bubble default example to replace the model initialisation line:
A runnable version can be found here
Expected behavior The status and title panels should remain visible.
Screenshots Expected (although this shows no padding): Problem output (padding causes the top title and status panels to be hidden): Attempting to differentiate headings in list items by adding padding is what exposed this issue.