triniwiz / nativescript-pager

Apache License 2.0
90 stars 48 forks source link

Android: selectedIndexChagned-Event not called after pager.scrollToIndexAnimated with animated=false #166

Open felixkrautschuk opened 4 years ago

felixkrautschuk commented 4 years ago

If the demo apps cannot help and there is no issue for your problem, tell us about it

When changing the selectedIndex of the pager component programatically using pager.scrollToIndexAnimated(newIndex, false); (using animated = false), the selectedIndexChange-Event seems not to be called correctly.

I tested the native viewpager2 demo from https://github.com/android/views-widgets-samples/tree/master/ViewPager2 and I couldn't reproduce this issue there.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

After starting the demo app provided below, tap the button to navigate to the pager page and tap the button to move forward. The pager will move to the correct page, but the selectedIndex event won't be called, as you ctually would see a log message in the console and the text should be loaded into the HtmlView, but this does not happen.

You can tap the " >> " Button in the ActionBar, which uses pager.scrollToIndexAnimated(index, true) and there everything works as expected.

Is there any code involved?

NSPagerScrollIssueAndroid.zip

triniwiz commented 4 years ago

Thanks I know what’s causing the issue