ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.94k stars 13.52k forks source link

inffinite scrolling is not working in slider in 2.0.1 (was working in beta11) #10387

Closed martijnlutgens closed 7 years ago

martijnlutgens commented 7 years ago

Ionic version: (check one with "x") [ ] 1.x [x ] 2.0.1

I'm submitting a ... (check one with "x") [ x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: I have implemented a solution in my app to use swipepable tabs by using a segment with a slider. I had this working in the beta11 version. Ik have just migrated to 2.0.1 and it now has weird behavoir when inspecting in Chrome on the various devices. See steps to reproduce.

Expected behavior: just scroll en refresh.

Steps to reproduce: I had to wrap the content in the slide in a

to enable vertical scrolling. responsive and android: infinite scroll is not triggered when scrolling down. iPhone/iPad: infinitescroll is triggered the first time when scrolling down. After that you have to scroll to top and then the infinite scroll is triggered. When scrolling down again it is triggered again one time. Now you can repeat scrolling to top and down to keep refreshing...

Related code:

The template code:

`

Sample
` The Typescript code: import { ViewChild, Component } from '@angular/core'; import { NavController, Slides } from 'ionic-angular'; @Component({ templateUrl: 'tabs.html' }) export class TabsPage { currState = "0"; data = {chats: []}; @ViewChild('chatSlides') slider: Slides; constructor() { for (var index = 0; index <= 10; index++) { this.data.chats.push({ text: 'item ' + index }) } } onSlideChanged() { let currentIndex = this.slider.getActiveIndex(); this.currState = String(currentIndex); } onSegmentChanged(event) { let currentIndex = event.value; this.slider.slideTo(currentIndex, 150); } doInfiniteChats(infiniteScroll) { let start = this.data.chats.length; let end = start + 10; for (var index = start; index <= end; index++) { this.data.chats.push({ text: 'item ' + index }) } infiniteScroll.complete(); } } **Other information:** **Ionic info:** (run `ionic info` from a terminal/cmd prompt and paste output below): Ionic Framework Version: 2.0.1 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.5 Xcode version: Not installed
jgw96 commented 7 years ago

Hello! Thanks for opening an issue with us! As this seems like more of a support question about some custom functionality you have built i will urge that you ask this question on our forum or on our slack channel. Thanks for using Ionic!

ionitron-bot[bot] commented 6 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.