Not sure if this is known, but I've just created an issue regarding the Content Scroll Snap Horizontal. I know I must be a pain finding issues with this one control :P
A very Merry Christmas and a happy new 2021 to all users of the Unity UI Extensions project. We're truly honored you chose to include us in your project and just as happy it helps you be successful faster and quicker!
If there is something else you need in the UI world, let us know on the BitBucket site and we'd be happy to help.
Then GetScrollOffset is called with the following values
UIScrollToSelection.GetScrollOffset(position = 0, listAnchorPosition = 0, targetLength = 100, maskLength= 708)
And returns the value = 808
Which leads to a change in the verticalNormalizedPosition from 1.0
Before: TargetScrollRect.verticalNormalizedPosition 1.00
After: TargetScrollRect.verticalNormalizedPosition 1.06...
Which in ScrollRect.MovementType == Elastic leads to the flickering movement.
So in GetScrollOffset() for a position that requires 0 scrolling ( as i see it, correct me if i'm wrong ),
this leads to scrolling of 1 heigth of the control, if there's less than 0.5 height of the control distance the the top border.
if (position < listAnchorPosition + (targetLength / 2))
// 808 = ( 708 ) - ( -100)
return (listAnchorPosition + maskLength) - (position - targetLength);
DistributePagesfunction to reset the view. I'll try and do some testing with this approach and maybe add another example. Let me know if this works for you.
updatefor making alterations to UI controls, always use
LateUpdateJust Because Unity... :D (has to do with the execution order for when the UI is updated). Better to plan updates for the start of the next frame than try to alter UI before render.