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.


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.

Login to Vote

ComponentUE - Editor - UI Systems - Slate
Affects Versions4.27
CreatedMay 4, 2022
UpdatedDec 9, 2022