Unable to transition slides in AngularJS on Safari iOS 9 due to malfunctions

Having some CSS classes that smoothly slide my ng-view left and right during route change, everything was working well on most browsers and phones until now. Under ios 9, the animation is not functioning properly. Instead of sliding left to right, the view grows from a small size to full size while sliding, creating an unpleasant effect. Any assistance would be appreciated!

CSS

.slide-left.ng-enter,
    .slide-left.ng-leave,
    .slide-right.ng-enter,
    .slide-right.ng-leave {
        position: absolute;
        top: 58px; right: 0; bottom: 0; left: 0;
        background: inherit;
        -ms-transition: 0.35s ease-in-out;
        -webkit-transition: 0.35s ease-in-out;
        -moz-transition: 0.35s ease-in-out;
        -o-transition: 0.35s ease-in-out;
        transition:  0.35s ease-in-out;
    }
    .slide-left.ng-enter {
        z-index: 101;
        -webkit-transform: translateX(100%);
        -ms-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -o-transform: translateX(100%);
        transform: translateX(100%);
    }
    .slide-left.ng-enter.ng-enter-active {
        -webkit-transform: translateX(0);
        -moz-transform: translateX(0);
        -o-transform: translateX(0);
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    .slide-left.ng-leave {
        z-index: 100;
        -webkit-transform: translateX(0);
        -moz-transform: translateX(0);
        -o-transform: translateX(0);
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    .slide-left.ng-leave.ng-leave-active {
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -o-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        transform: translateX(-100%);
    }
    .slide-right.ng-enter {
        z-index: 100;
        -webkit-transform: translateX(-100%);
        -moz-transform: translateX(-100%);
        -o-transform: translateX(-100%);
        -ms-transform: translateX(-100%);
        transform: translateX(-100%);
    }
    .slide-right.ng-enter.ng-enter-active {
        -webkit-transform: translateX(0);
        -moz-transform: translateX(0);
        -o-transform: translateX(0);
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    .slide-right.ng-leave {
        z-index: 101;
        -webkit-transform: translateX(0);
        -moz-transform: translateX(0);
        -o-transform: translateX(0);
        -ms-transform: translateX(0);
        transform: translateX(0);
    }
    .slide-right.ng-leave.ng-leave-active {
        -webkit-transform: translateX(100%);
        -moz-transform: translateX(100%);
        -o-transform: translateX(100%);
        -ms-transform: translateX(100%);
        transform: translateX(100%);
    }

JS

$rootScope.$on('$routeChangeStart', function() {
            //event button to move backward
            $rootScope.back = function() {
                $rootScope.slideClass = 'slide-right';
            };
            //event button item list to move forward
            $rootScope.next = function() {
                $rootScope.slideClass = 'slide-left';
            };
            $rootScope.stay = function() {
                $rootScope.slideClass = 'slide-none';
            };
        });

MARKUP

<div data-ng-class="slideClass" autoscroll="true" data-ng-view></div>


UPDATE


Addressing a similar issue posted by Diego on ios 9 mobile safari has a blinking bug with transform scale3d and translate3d, I have found a partial solution. By applying overflow: hidden on a parent element, the animation problem seems to be resolved. However, this workaround breaks scrolling functionality. Quoting Diego, "It seems to be a bug with nested layer composition and sizing of the viewport. Adding overflow: hidden in a parent layer seems to solve the problem." While this is a step in the right direction, it is not yet a complete solution.

Answer №1

If you're looking for a solution, there is a helpful discussion on the topic available here

In summary: To resolve this issue, it is recommended to adjust the meta viewport's scale values slightly above 1.

<meta name="viewport" content="initial-scale=1.0001, minimum-scale=1.0001, maximum-scale=1.0001, user-scalable=no"/>

For better results, consider targeting only IOS devices with the following code:

if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
  document.querySelector('meta[name=viewport]').setAttribute(
    'content', 
    'initial-scale=1.0001, minimum-scale=1.0001, maximum-scale=1.0001, user-scalable=no'
  );
}

Answer №2

After some trial and error, I discovered that the translateX function was behaving oddly on iOS 9... Switching from using translateX(<whatever>) to

translate3d(<whatever>, 0, 0)
resolved the issue and restored sanity to my transforms.

Give it a shot!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are some solutions for adjusting this sidebar for mobile devices?

My mobile version sidebar is not functioning properly on my website. To see the issue, you can visit Zinexium. As I am new to HTML, I don't know how to fix it. Here is a link to the code. Thank you! <!DOCTYPE html> // Code snip ...

How to retrieve the length of data in Angular without relying on ng-repeat?

I am currently working with Angular and facing a challenge where I need to display the total length of an array without using ng-repeat. Here is the situation: I have a default.json file: { { ... "data": [{ "name":"Test", "erro ...

How to pass parameters to the ng-click function in an ng-repeat loop

For my angular ionic application, I have implemented onclick="window.open('tel:+94777122240')" which triggers the dial box when clicked. I am attempting to pass values to the onclick function within a ng-repeat. However, the values from the ng-re ...

Running a website on a virtual server

I am working on a webpage that presents results from an angular application, and I want to host it on a web server located on my virtual machine. This will allow my team members to easily access the page daily. However, I am unsure of how to proceed with ...

Import necessary styles into the shadow DOM

Embracing the concept of shadow dom styles encapsulation is exciting, but I wish to incorporate base styles into each shadow dom as well (reset, typography, etc). <head> <link rel="stylesheet" href="core.css"> ... </h ...

What are the best techniques for centering a prime ng form both vertically and horizontally?

I am currently using prime ng 9.1.3 along with primeflex 1.3.0 in my project. Despite applying p-align-center, I am facing difficulty in vertically and horizontally centering the form on the screen when using a full screen height of 100vh. <div class=&q ...

Stacking divs one on top of the other

My goal is to design a simple webpage with two full screen background colored divs. On top of these background divs, I want to add two smaller divs where I can input text and place a button underneath to randomize the words (refer to the attached screensho ...

Utilizing AngularJS to Transmit Byte Arrays in Form Data to an API

My current challenge involves sending a byte array to an API alongside some field data, as depicted in the figure. I am hesitant to use modules from the AngularJS community because they do not provide clear information on how the data is transferred, and m ...

Intercepting HTTP response errors is preventing the $http error callback from being invoked during testing with $httpBackend

Currently, I'm in the process of testing an angular service method using $httpBackend. The goal is to mock different responses depending on the request data. The issue arises when attempting to simulate an error status for invalid requests; despite se ...

Developing an Angular Chart with AJAX

Utilizing the power of angular-chart.js, I have successfully generated a chart with the provided code snippet. However, my goal is to dynamically generate a chart using AJAX calls. Unfortunately, when I attempt to load the chart through AJAX, it fails to r ...

How to style a sublevel menu to appear next to its parent using CSS

I have a menu that is currently functioning well, but I would like to add a new sublevel onto it. However, if I directly add the new options, they end up hiding the existing ones on the menu. Here's an image for reference: I want the new options to ...

Can an Expression be incorporated into the ng-model Directive?

I am facing an issue with my loop: <div ng-repeat="measure in CompleteDataSetViewModel.TargetMeasures"> </div> Within this loop, I have an input field: <input ng-model="CompleteDataSetViewModel.AnnualRecord.Target[measure.Name]_Original" ...

What could be the reason for my Form styling failure?

Currently working on freecodecamp's portfolio creation exercise. It should be a straightforward task, but I'm facing a small issue that's puzzling me. I'm trying to remove the border and outline (when focused) from my contact-area form ...

Changing focus to 'DIV' element without JQuery using Javascript and Angular's ng-click event

Instructions for using an Angular directive to set focus on a "DIV" element when clicked <a href="#" class="skipToContent" ng-click="showContent()" title="skip-to-main-content">Skip To Main Content</a> <div class="getFocus" role="button" ...

Visual Latency when Quickly Toggling Between Images in Succession

I have a series of 50 images that need to be displayed sequentially inside a div. The time interval between displaying each image is initially set at 750 milliseconds and decreases with each subsequent image. To ensure all images are loaded before the an ...

Unable to implement CSS styles on the provided HTML code

I'm currently working on integrating evoPDF into my asp.net application. When I click on a part of the HTML file, I send that portion using AJAX. So far, everything is working well up to this point. However, when I try to use the following methods fro ...

Switch up the appearance of a document by manipulating the stylesheet using a select tag

I'm currently facing an issue with the implementation of a drop-down box on my website for selecting different themes. Despite having the necessary javascript code, I am unable to get it working correctly. Here's the snippet: //selecting the sele ...

Is there a way to rearrange html elements using media queries?

Here is a snippet of code showcasing how my website is structured for both desktop and mobile views. Display on Desktop <body> <div> <header> <div>example</div> <a><img src"my logo is here"/& ...

Tips for retrieving information from a web endpoint using Angular

My task involves utilizing Angular to retrieve data from a web endpoint and display it to the user. The setup requires configuration through bower and the use of grunt as a task manager. I have already installed bower, Angular, and Bootstrap, with the pag ...

Leveraging AngularJS services within an Angular service

I am currently in the process of transitioning my AngularJS application to Angular. To facilitate this transition, I plan to create a hybrid application that combines both frameworks until the conversion is complete. However, I have encountered an issue wi ...