Issue with CSS transition bug in Offcanvas on Android version 4.1.x

I am attempting to develop an offcanvas menu similar to the one featured in the Google Plus app.

Currently, my code functions properly on most devices (android/ios) and browsers (ff, chrome, IE8+).

The only issue I am encountering is on a Samsung Galaxy Tab 3 running Android 4.1.2: when I enable the opacity transition of the dark/opaque layer on the right, the offcanvas menu fails to hide upon closing, causing a disruption in my application.

You can observe this problem in action on two fiddles with Android 4.1.2:

Here is the relevant CSS code (SASS version below, CSS version on jsfiddle):

(PS: The issue arises if you uncomment the two transition lines)

html, body {
    overflow-x: hidden;
    /*height: 100%;*/
}

.sidebar-offcanvas {
    height: 100%;
    position: absolute;
}

a[data-toggle=offcanvas]:focus {
    outline: none;
}

$global-site-min-height: 520px; /*TODO: replace this by better css or JS*/
#sidebar {
    padding-left: 0;
    padding-right: 0;
    min-height: $global-site-min-height;
    background-color: lighten($gray-light, 30%);

    .left-sidebar {
        padding: 0 15px;
    }
}

#rightpanel {
    height: 100%;
    min-height: $global-site-min-height;
    padding-left: 0;
    padding-right: 0;
}

.wrapper {
    overflow: hidden;
}

.row-offcanvas {
    position: relative;
}

@media screen and (max-width: $screen-xs-max) {

    $sidebar-width: 40%;

    #togleSidebar {
        display: block;
    }

    .sidebar-offcanvas {
        @include transition(left 0.15s linear, opacity 0.15s linear);
        height: 100%;
        z-index: 9500;
        top: 0;
        width: $sidebar-width;
        left: -$sidebar-width;
    }

    #rightpanel-shadow {
        background: #000 !important;
        position: absolute;
        width: 100%;
        height: 100%;
        visibility: hidden;
        @include opacity(0);
        z-index: 9250;
        @include transition(opacity 0.15s linear); /* SECOND FIDDLE WORKS IF COMMENTED*/
    }

    .active {
        .sidebar-offcanvas {
            left: 0;
            @include box-shadow(6px 0px 6px -2px #111111);
            @include transition(left 0.15s linear, opacity 0.15s linear);

        }

        #rightpanel-shadow {
            visibility: visible;
            @include opacity(0.75);
            transition-delay: 0s;
            zoom: 1;
            @include transition(opacity 0.15s linear); /* SECOND FIDDLE WORKS IF COMMENTED*/
        }
    }
}

Answer №1

If you're looking to improve your animations, it's best to avoid declaring multiple animations like this:

transition: left 0.15s linear, opacity 0.15s linear;

Instead, consider adding a new nested element and applying the additional animation there.

The default Samsung browser may not handle multiple animations well (especially with older versions), so it's worth optimizing for compatibility.

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

Top-to-Bottom Border Vanishing

I have a div that has a left border with the following style: border-left: 3px solid #F90; Now, I want the border to fade out gradually from top to bottom, going from full opacity at the top to completely transparent at the bottom. However, my attempt usi ...

Efforts to seamlessly combine two divisions of a business card through the use of CSS and HTML

Currently, I am working on designing a business card that includes both front and back sections. Below is the code snippet that I have been using: .business-card:hover .front{ transform: perspective(700px) rotateX(180deg); } .business-card .back{ tr ...

"Customize your Vuetify v-card with uniquely styled rounded corners on only

I am seeking to create a unique v-card design where only two corners are rounded. Despite my attempts, the card ended up rotated by 90° and didn't achieve the desired outcome. DESIGN ATTEMPT: <div class="text-center rotate-ninety ml-n6" ...

Creating a HTML and JavaScript carousel without relying on the animate function

I am currently facing some challenges with building a custom slider. While it moves forward smoothly using CSS animation, I'm struggling to implement a backward motion with an animation. It seems like I need to loop through the slides and try a differ ...

Having trouble sending the selected value from a dropdown list to the server using $.ajax

I am embarking on my first project using JQuery (jquery-3.0.0.min.js) and JavaScript. My goal is to build a straightforward web form that connects to a database through a Web API. The form consists of various input text fields and two select dropdowns. ...

Different ways to update the AutoComplete Style attribute

MuiInput-formControl { margin-top: 16px; Is there a way to reset the marginTop property to zero? I attempted the following method, but it was not successful. MuiFormControlLabel: { marginTop: 0, }, <Autocomplete disabl ...

What is the best way to position a div as a footer within a larger main div?

I am aiming to create a div with simple header, content, and footer sections. Here is the design I am trying to achieve: https://i.stack.imgur.com/QfnGa.png You can check out my code on jsfiddle. I'm having trouble understanding how the relative lay ...

Angular 2: Change Boolean value depending on a condition

I find myself facing a challenge with a search-bar feature. My goal is to display all the filtered names when the input value reaches a length of 2 or more characters. After successfully extracting the value.length from the input field, I encountered a ro ...

What is the best approach to passing multiple variables to a JavaScript function in HTML/PHP?

Seeking help with calling a javascript function from PHP through embedded HTML code. Below is the script: <script> // THE FOLLOWING JAVASCRIPT FUNCTION REDIRECTS TO EDITUSER.PHP AND PASSES USERID VALUE. function startMaint(mo, yr){ ...

The Server-Sent Event feature seems to be malfunctioning as it appears that browsers are unable to detect any events sent through Server-Sent

I have successfully implemented server-sent events (HTML5) in my project without using node.js. It is a simple webpage (another JSP page) that makes a call and receives a response. However, when I receive the response, none of the methods/functions (onopen ...

Position the Bootstrap button on the right side

this is the code I am working with: <p class="h1 p-3 mb-2 bg-danger text-white text-danger">Lagerbestand unter Mindestmenge! </p> <br /> <div class="border text-center"> <p class="h5 text-center">Durc ...

What is the best way to loop through <div> elements that have various class names using Python 3.7 and the Selenium webdriver?

I am currently in the process of creating a Reddit bot that provides me with a detailed report about my profile. One task I need to accomplish is identifying which of my comments has received the most likes. Each comment on Reddit is wrapped in elements w ...

Transform HTML content into a PDF document with page breaks

Currently, I am developing a function that involves an HTML template. The purpose of this function is to generate a dynamic template and convert it into a PDF. So far, I have been able to achieve this using the following code: var output = ''; ...

The dropdown menu vanishes from sight as soon as the cursor moves away from a link

Recently, I encountered an issue while trying to create a dropdown menu using Jquery. The problem arose when attempting to select the second link, as the entire menu would disappear. Additionally, is there a way to ensure that only one dropdown menu is vis ...

What could be the reason why certain animations fail to run on specific icons when hovering over the parent element?

I recently launched my website which features a series of tabs with unique icons. Some of the icons, labeled as soap-icon, have animated effects while others, categorized under icomoon-icon, do not. Upon checking the console, I discovered that the animati ...

Guide to converting a specific tag into div using Javascript

I am working with some HTML code that includes a div: <div class="myDiv"> <a href="" title="">My link</a> <p>This is a paragraph</p> <script>//This is a script</script> </div> Additionally, I ha ...

Adjusting the appearance of internal components with material-ui icons

Currently working on a project using react and material-ui where I am looking to customize the styles of specific elements within components. An example is the ListItem component which includes primaryText, leftIcon among others, and my goal is to modify t ...

Tips for adjusting this CSS to be compatible with Internet Explorer

This CSS code I have was created specifically for Firefox compatibility. /* Green header */ .container { background: linear-gradient(#5FA309, #3B8018); position: relative; display: inline-block; padding: 0 20px 0 10px; width: 270px; ...

Issues with CSS styling are affecting the display of a form

Hey there! I was working on creating an order form for my website, and everything was going smoothly until I hit a snag while styling the webpage. The problem is that the legends of the form are extending all the way to the right side of the page, and the ...

What's the best way to adjust the card column for mobile view resizing?

I am trying to modify the card view for mobile devices to display as a 2-column layout. I have adjusted the flex length and grid size in my code, but I still can't achieve the desired result. Can someone guide me on how to make this change? Current d ...