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

Guide to setting up a UIScrollView with vertical constraints using VisualFormat in SWIFT

Struggling to implement UIScrollView in my app using constraintsWithVisualFormat. Any helpful guides or code snippets would be greatly appreciated. Thank you! import UIKit class ViewController: UIViewController, UIScrollViewDelegate{ var scrollView: ...

I'm feeling a bit lost on where to go next with this JavaScript

I've been working on a project in Python where I need to retrieve a file, store it in an array, and display a random string from the array on HTML. However, I have no experience with JavaScript and am unsure how to proceed. I suspect there may be an i ...

Having trouble setting a background image for a specific DIV element in HTML

I am in the process of updating my webpage, and need some assistance implementing a small background image. Here is what I have done so far: https://i.sstatic.net/nTxtD.png Below is the marked section where I am trying to add the background image: https ...

Within a container, there are two divs separated by a white bar

Hello everyone, I am in need of creating a unique slideshow for my website and I want to start by splitting a div into two sections using a slightly skewed diagonal line that is either semi-transparent black or solid white. I have searched extensively onli ...

The table is not properly displaying within the parent scrolled div due to issues with the fixed positioning

Apologies for any language barrier. I am encountering an issue with a PHP page that includes a table meant to be displayed as position:fixed; however, it consistently appears above the scrollbars and does not stay within the parent div. View screenshot he ...

Make the Angular Modal scrollable except for when a specific div is being click dragged

I am working on an Ionic app that uses AngularJS. One issue I encountered is with a modal popup that can sometimes extend beyond the visible area. To address this, we applied overflow: hidden to its CSS class. However, there is a specific functionality i ...

A guide to incorporating external CSS files in Angular 5 components using styleUrls

I have a unique setup where my Angular 5 application resides in a subdirectory within another parent application. The parent application consists of JSP and other AngularJS applications among other things. My goal is to include a CSS file from the parent ...

Are there any alternatives to the OSX "texturetool" for converting PNG image data to PowerVR?

I am in search of alternatives to the texturetool command line program found in XCode for converting PNG images into PowerVR compressed images. Texturetool is taking around 50 seconds to convert some of my images, and with 1.3 million images to compress, ...

What is the process for creating a stationary container positioned on the left side, which extends vertically down the page to showcase a collection of skills?

Hey there, I'm a newcomer to web development. For my very first project, I'm working on a resume page. I'm looking to have a fixed left div where I can showcase my skills, and a larger div on the right side for the main body content containi ...

Console is displaying an error message stating that the $http.post function is returning

Just diving into angular and I've set up a controller to fetch data from a factory that's loaded with an $http.get method connecting to a RESTful API: videoModule.factory('myFactory', function($http){ var factory = {}; facto ...

Enhance your table layout with Bootstrap 3 by adjusting textarea size to fill

I am currently in the process of developing a forum and bulletin board software. I am facing some challenges while trying to integrate a reply section into the thread page. You can view what I have implemented so far here. Html: <div class="panel pane ...

When an input field is added to an HTML form, all elements positioned below it automatically inherit its attributes

I have a unique combination of HTML and CSS code that creates an impressive login form: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Prepare to be amazed...</title> <l ...

What could be causing my CSS/Layout to alter once AJAX/JavaScript has been executed?

When the user clicks, an AJAX call is made to retrieve data from a third-party API. The frontend/layout renders correctly before this action; however, after the data is fetched and displayed in the frontend, the layout changes. Upon debugging multiple tim ...

Animation controlled by a button

I'm working on a project that involves creating a cartoon version of a record player. I want to incorporate an animation where the play button on the side toggles the spinning motion of the record using webkit, while also starting the audio track. The ...

Obtain selected values from another view

When I have a list of checkboxes and a submit button, clicking on the submit button should display all checked values in another view table. Most solutions suggest getting the values in the same view, but I specifically need to retrieve the values in a dif ...

I'm having an issue where my footer is getting cut off when I resize the browser and start side scrolling. Can

I designed a webpage with a footer that contains another div holding centered content. The footer is supposed to span the entire width, while the inner content div is set to 960px with a margin auto to center it. <footer> <div class="footer-in ...

Send a JSON object from an AngularJS application to an MVC controller

When attempting to pass JSON data from AngularJS to MVC, an error is encountered. The HTTP request configuration URL must be a string or a trusted $sce object. Error received: {"method":"POST","url":"Home/SavePDDetails","datatype":"json","data":{"PD": ...

Is there a way to move a placeholder to a small label in the top left corner when an input field is being used?

I've been searching for functional code, but everything I've tried so far hasn't worked. Does anyone have expertise in creating this animation using React? ...

What steps can I take to ensure that my logos remain visible even when I close the menu and resize the window?

On my website, I have a menu of logos that are clickable. These logos always display except on smaller screens, where they need to be toggled to show using a hamburger menu. The menu toggles fine when it is on a smaller screen, but there is an issue when y ...

Button in Angular gets stuck when a touchscreen is long pressed

In my Angular2 application, I am facing an issue with a button when running on a Windows 10 touchscreen PC in Chrome. Normally, the button works fine and executes the click function. However, if the button is held for 1-2 seconds, it gets stuck and fails t ...