charmbracelet / charmbracelet/bubbles
List : list panel pushed into title/status panels by padding on items
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 457
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Description
**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:
- Linux 6.5.0-5-amd64
- bash 5.2.21-2
- rxvt-unicode 9.31-3
- Locale is en_GB.UTF-8
**To Reproduce**
Add padding to the Title elements.
**Source Code**
Add the following to the bubbletea [list bubble default example](https://github.com/charmbracelet/bubbletea/blob/master/examples/list-default/main.go) to replace the model initialisation line:
```go
ddStyles := list.NewDefaultItemStyles()
ddStyles.NormalTitle.PaddingTop(1)
ddStyles.DimmedTitle.PaddingTop(1)
ddStyles.SelectedTitle.PaddingTop(1)
ndd := func() list.DefaultDelegate {
ldd := list.DefaultDelegate{
ShowDescription: true,
Styles: ddStyles,
}
ldd.SetHeight(2)
ldd.SetSpacing(1)
return ldd
}
m := model{list: list.New(items, ndd(), 0, 0)} // model initialisation
```
A runnable version can be found [here](https://gist.github.com/rorycl/264a56ab4e4d15c07c63cb5fc651f771#file-list-go-L77)
**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.

Contributor guide
Assessment
This issue has not been assessed yet.