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
51.02k stars 13.52k forks source link

[2.0.0-rc.1] [iOS] Swipe to go back breaks page #8973

Closed netcell closed 7 years ago

netcell commented 7 years ago

Short description of the problem:

On iOs, after swipe to go back to a page, that page seems to lose data binding. Actions still activate functions, but data are not rendered into view. This doesn't happen if back button on navigation bar was used instead.

Check this repository for a source code that is suffering from the problem, modified from the sidemenu starter template

What behavior are you expecting?

Swipe to go back should act the same as back button and not break the page.

Steps to reproduce:

  1. Create a page with
    • ion-navbar
    • ion-list with items that push other pages that also have ion-navbar
    • ion-searchbar with showCancelButton and use ionInput to filter the items in ion-list
  2. Build and run/emulate on iOs
  3. Click on an item to go to another page.
  4. Click back button on navbar
  5. Try search bar to see that the page is still working, the list is updated as user is typing. Notice that when tap on search bar would still display 'Cancel' button on the right side at this step.
  6. Repeat step 3, then go to step 7.
  7. Swipe to go bage to the list page.
  8. Try search bar to see that the list is NOT updated as user is typing. Notice that when tap on search bar, it does NOT display 'Cancel' button on the right side.

Expectation: At step 8, the page should still be working as in step 5.

Related Information

  1. Check this repository for a source code that is suffering from the problem, modified from the sidemenu starter template.
  2. I did check the issue #8958 but it doesn't seem related since I do not implement ionViewWillEnter or ionViewDidEnter. UPDATE: Please read this comment.
  3. I did try implementing ionViewDidEnter for calling ChangeDetectorRef.detectChanges and ChangeDetectorRef.reattach just in case, but they doesn't seem to have any effect.
  4. I saw no error or warning or log in the console (safari web inspector connected to the emulator iOS 9.2).
  5. The issue also happens on IonicView app running on iOS 10.1, iOS 9.3.5.

Ionic Version 2.0.0-rc.1

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.7.1
Xcode version: Xcode 7.2.1 Build version 7C1002
neelz040 commented 7 years ago

This is exactly my issue too (#8958) just much more in detail :-) 👍 Good explanation !

manucorporat commented 7 years ago

I submitted a PR to fix #8958

jgw96 commented 7 years ago

@manucorporat I can confirm that with your SwipeToGoBack PR I did not see this issue, so looks like its fixed.

jgw96 commented 7 years ago

I am going to close this issue as a duplicate of #8958 for now since that issue is the underlying cause of this issue. Thanks everyone and thanks @netcell for the detailed issue!