Terminal.Gui
Terminal.Gui copied to clipboard
List View Example doesn't show last entry when keeping content in viewport
Describe the bug The List view in combination with the ScrollBarView doesn't show the last entry in the list view if the "Keep Content in Viewport". Instead the 2nd to last entry (WizardAsView) is shown.
To Reproduce Steps to reproduce the behavior:
- Start the UICatalog Project
- Open the "List View With Selection" Scenario
- Make sure
- Scroll down to the last entry (via mouse wheel or scrollbar)
Expected behavior The last entry (Wizards) should be shown.
Screenshots
Last entry is not shown with option enabled:
Last entry is shown with option disabled:
Desktop
- OS: Windows
Additional context Fixed it locally by setting the scrollbar size to the source count: https://github.com/gui-cs/Terminal.Gui/blob/bfd8b4e45701af03a12519df5a4be3baffe1500b/UICatalog/Scenarios/ListViewWithSelection.cs#L82-L84
_scrollBar.Size = _listView.Source.Count;
_scrollBar.Position = _listView.TopItem;
_scrollBar.OtherScrollBarView.Size = _listView.Maxlength;
This change was done in the commit https://github.com/gui-cs/Terminal.Gui/commit/f9f68048a2e1a9f8259674b80baebab35b25e354, but idk if something changed that broke it.