Unity-UI-Extensions/com.unity.uiextensions

BUG: OnSelectionPageChangedEvent is not invoked in ScrollSnapBase.ScrollToClosestElement()

Closed this issue · 6 comments

Unity UI Extensions Bug Report

Describe the bug

I'm using VerticalScrollSnap in my UI window, and I noticed one problem. In some cases, when I drag an object to scroll to the next or previous, there is no OnSelectionPageChangedEvent invoked.
For an experiment, I tried to add this
ScreenChange();
in ScrollSnapBase.ScrollToClosestElement() after this
GetPositionforPage(_currentPage, ref _lerp_target);
and it fixed my problem, as I can see.
Maybe you can include this fix in next update? If I'm correct of course :)

Good find, I did look around to see if there were any other edge cases, but that seemed the only one, other screen changes are triggered via the transition lerp

Actually scratch that, in further testing this causes unwanted behaviour, as while the control is settling, the event is continuously fired.
The proper state in which the event is fired is when the Lerp of the control has finished.

I would love to understand your issue more, as on reflection, I'm unable to replicate your scenario @xvarankina , the event always fires in the Example Scene for the HSS/VSS.

Have you changed some other settings on the base ScrollRect?

My settings:
Screenshot_4
Screenshot_3

Apologies @xvarankina it has been a bit hectic. There do not seem to be any clear differences between your setup and the HSS/VSS samples provided alongside the package.

So far, using the examples I have been unable to replicate the problem you are experiencing.

Can you confirm you can replicate the issue using the samples, or can you provide a simple scene with your setup that can replicate it so I can test with?

I tried to do a simple scene with setup, but today I fixed my problem by changing settings :) Enabled UseHardSwipe and disabled UseFastSwipe.
Sorry to disturb you @SimonDarksideJ it looks ok now.

Thanks @xvarankina but never apologise, as the issue you logged and the solution will no doubt help others experiencing the same thing :D

Glad you got it up and running.