Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
felixkrautschuk opened this issue Mar 4, 2020 · 1 comment

Comments

@felixkrautschuk
Copy link

felixkrautschuk commented Mar 4, 2020

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?

  • Android
  • tested on Android 4, Android 7.1.1 and Android 10
  • emulator and device

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

  • CLI: 6.4.1
  • Cross-platform modules: 6.4.2
  • Runtime(s): tns-android 6.4.1
  • Plugin(s): nativescript-pager@12.0.0.alpha8

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
Copy link
Owner

triniwiz commented Mar 5, 2020

Thanks I know what’s causing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants