Description

Since the contents of a ListView are virtualized, the ListView estimates the size of the scroll box's contents based on the on-screen elements. This can lead to some situations where DistanceFromBottom returns a negative number, preventing the box from scrolling to display the bottom element. More information is available on the linked UDN post, as well as a potential fix:

if (ReGenerateResults.ExactNumLinesOnScreen < 1.0f)
{
	// We are be observing a single row which is larger than the available visible area, so we should calculate thumb size based on that
	const double VisibleSizeFraction = AllottedGeometry.GetLocalSize().Y / ReGenerateResults.LengthOfGeneratedItems;
	double ThumbSizeFraction = FMath::Min(VisibleSizeFraction, 1.0);
	const double OffsetFraction = CurrentScrollOffset / NumItemsBeingObserved;
	// If the visible size fraction is too large it will prevent the user from being able to scroll to the end of the list
	if (!ReGenerateResults.bGeneratedPastLastItem)
	{
		ThumbSizeFraction -= OffsetFraction;
	}
	ScrollBar->SetState( OffsetFraction, ThumbSizeFraction );
}

Incorrectly estimating the scroll bar's position may be unavoidable since off-screen list items are purely virtual and don't have an associated widget to measure, but distance from the bottom should never return a negative value.

[Link Removed] proposed a potential alternative solution to investigate, clamping both ThumbSizeFraction and OffsetFraction in SScrollBarTrack::SetSizes between 0 and 1.0.

 

 

NOTE ALSO: From [Link Removed] Dylan Dumesnil noted:

  • Fix the scrollbar for variable height entries. Update STableViewBase::Tick to calculate the full size of the list and update the scrollbar accordingly.
    • There will be plumbing involved to get the list of unique entry widgets here since that would only be known by UMG
    • We should expose a flag to opt-in to this variable height entries calculation since it will be more expensive than the current implementation
    • There may be other updates needed to scrolling logic as everything works in number of lines, assuming all lines are of equal height
    • Would be nice to enable this for details panels since they commonly have issues with variable height rows (edited) ** 
    • once fixing the scrollbar, we need to confirm that DistanceRemaining value is also now correct in the OnListViewScrolled event.  Currently with lists that have variable entry heights, the list can be scrolled to the bottom but the DistanceRemaining variable will report a non zero value.  

 

Steps to Reproduce
  1. Create an IPropertyTypeCustomization that uses an SVerticalBox to display several widgets in a single property row
  2. Add this property to an actor, and view the details panel for that actor
  3. Attempt to scroll down using the mouse wheel, and note that the scroll bar may reach the bottom of the scroll box before the last item in the panel is visible

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-151120 in the post.

0
Login to Vote

Backlogged
ComponentUE - Editor - UI Systems - Slate
Affects Versions4.27
CreatedMay 4, 2022
UpdatedJun 16, 2025
View Jira Issue