Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9705

Cordova - window.history.back() not working on HTML back button in iOS 9

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.8.0
    • 3.8.0
    • cordova-cli, cordova-ios
    • XCODE 7.0, iOS 9 I am getting this issue. Where as prior to iOS 9 versions like iOS 8,iOS 7 and iOS 6 it is working perfectly.

    • Important

    Description

      In my application I am using window.history.back to navigate back to previous View

      Declaration of back button

           <div class="back_icon"  id="verification_back_icon">
                  <a href="#" data- rel="back"  data-transition="slide down">
                 <img src="images/back_btn.png" width="23"/></a>
          </div>
      

      Button action:

           $("#verification_back_icon").on("click", function(e)
           {
              if(checkDirtyVacation())
               {
                   e.preventDefault();
                   if(backbtnAlt== false)
                  {
                     backbtnAlt =true; 
                     confirm("All data will be lost. Do you want to continue?",
                     function(r){
                            if(r){
                               //onBackKeyDown();
                               clearVacationvalues();
                               window.history.back();//this is not working in iOS 9
                           }else{
      
                         }
                         backbtnAlt =false;
                      });
                   }   
                }
               else 
               {
                  e.preventDefault();
                  if($(".vaction_location").hasClass("chkSelect"))
                 {    
                       $(".vaction_location").removeClass("chkSelect");
                      $(".vaction_location").addClass("chkUnSelect");
                 }
      
      
                     window.history.back();
                  }
               }); 
      

      This worked perfectly till iOS 8.4. In iOS 9 this navigation is not working.

      I am using Apache Cordova native platform version 3.8.0 .

      If anyone facing the similar problem please suggest me.

      Attachments

        Activity

          People

            Unassigned Unassigned
            veeraju veeraju
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified