Previous behaviour would mistakenly use boundary values from the focused SidebarIteminstead of a child from the ScrollView's content view, leading to content views not being initially rendered at scroll offset 0.0f.
This issue becomes evident when using long content views for SidebarItem elements beyond the first one.
The problem is fixed by checking if the focused view's parent matches the ScrollView's content view. If the focused item isn't a child of the content view, currentSelectionMiddleOnScreen is set to the content view's Y coordinate.
Previous behaviour would mistakenly use boundary values from the focused
SidebarItem
instead of a child from theScrollView
's content view, leading to content views not being initially rendered at scroll offset0.0f
.This issue becomes evident when using long content views for
SidebarItem
elements beyond the first one.The problem is fixed by checking if the focused view's parent matches the
ScrollView
's content view. If the focused item isn't a child of the content view,currentSelectionMiddleOnScreen
is set to the content view's Y coordinate.