Terminal.Gui icon indicating copy to clipboard operation
Terminal.Gui copied to clipboard

List View Example doesn't show last entry when keeping content in viewport

Open exp111 opened this issue 1 year ago • 0 comments

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:

  1. Start the UICatalog Project
  2. Open the "List View With Selection" Scenario
  3. Make sure
  4. 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: grafik Last entry is shown with option disabled: grafik

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.

exp111 avatar Sep 13 '23 15:09 exp111