Safari Version 8.0.2 experiencing issues with fixed positioning

I am currently working on an angular application and I find myself inside a Twitter Bootstrap modal.

My goal is to relocate a button that is located within the body of the modal to the footer of the modal using fixed positioning. This particular button triggers a function unique to the current modal-body scope, and it needs to stay in view regardless of scroll position. The modal-header and modal-footer always remain visible, while the modal-body content scrolls underneath those sections.

Everything behaves as expected when using Chrome.

I have come across various issues others have faced with fixed positioning in Safari, and I have tried implementing workarounds such as:

-webkit-transform:translateZ(1px);

I have also noticed that removing

transform: translate3d(0, 0, 0);

has proven to be helpful in certain scenarios. However, this rule is automatically applied to the bootstrap modal-dialog, so removing it is not feasible for me due to a multitude of misaligned elements that result from its removal.

In addition to these attempts, I have experimented with placing the button inside a parent element with absolute positioning and then with fixed positioning. I also attempted to remove the parent element altogether and place the button directly, but none of these strategies yielded successful results for me.

The CSS:

.stickyBut{
   position: fixed;
   bottom: 16px;
   left: 605px;
   z-index: 999999;

   /* -webkit-transform:translateZ(10px); failed */ 
} 
.but-hold{
   z-index: 999999; 
   width: 100%;
   height: 25px;
   position: absolute; 
   /* position: fixed; */
   top: 0;
   left: 0;

  /* FAILED
  -webkit-transform:translateZ(1);
  */
}

The HTML:

<div class="but-hold">
    <button class="btn btn-warning stickyBut" ng-click="submitProfile()">Save + Continue</button>
</div>

Any alternative solutions or suggestions would be greatly appreciated - thank you!

Answer №1

Regrettably, my attempt to resolve this issue using CSS proved futile. Instead, I had to revamp the modal design for each affected modal by eliminating fixed positioned elements and manually duplicating the inner content for all modals in the markup instead of relying on Angular to handle it automatically.

Upon further investigation, I have gained insights into z-index and the stacking context that may potentially be the root cause of the problem.

Each stacking context is anchored to a single HTML element as its root. When a new stacking context is established on an element, it restricts all child elements within a specific position in the stacking order. This implies that if an element is positioned within a stacking context at the lower end of the hierarchy, it cannot appear in front of another element in a different stacking context higher up in the hierarchy, even with a z-index value set to a high number! Phillip Walton Article

Answer №2

I encountered a similar issue where adding position:fixed to a child element within a parent with transform styling did not work as intended. It appears to be a known bug in webkit browsers.

To address this issue, you can either remove the transform property from the parent element or relocate the child element outside of the parent with the transform styling.

This scenario may be suitable for implementing a solution using bootstrap modal functionality.

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

Do arrays permanently retain the strings stored within them?

As an 11-year-old who has been learning Javascript for the past month and a half, I am currently working on creating a login/register system. Right now, my focus is on the register part. I have a question: when adding a string/number/boolean to an array, d ...

Applying CSS onmousemove does not function properly in conjunction with Bootstrap framework

Currently, I have a code snippet that enables an absolutely positioned box to follow the movement of the mouse cursor: $(document).mousemove( function(e) { $(".wordbox").css({ top: "calc(" + e.pageY + "px - 0.8em)", left: e.pageX }) ...

Differences between count() and length() methods in Protractor

When it comes to determining the number of elements inside the ElementArrayFinder (which is the result of calling element.all()), you have two options according to the documentation: $$(".myclass").length, detailed here: This approach involves using ...

Animation failing to be queued properly

Here is a snippet of code that moves a heading icon back and forth when you hover over the heading: jQuery('h1.heading').hover( function(){ $icon = jQuery('.heading-icon', this); if( ! $icon.is(':animated') ){ ...

Developing a Second Angular JS Application with a New Controller

Struggling to make my second AngularJS App and Controller work properly. The first one runs fine, but the second one never does. Should I try combining them into a single app with two controllers? Any advice or insights would be greatly appreciated. Thanks ...

Can the color of an ion-radio be adjusted when it is not selected?

I am experiencing an issue where I need to change the default color (grey) to a specific color of my choice, such as the primary color. I have attempted the following methods: <ion-col sizeXs="12" sizeMd="6" class="radio-box"> <ion-item line ...

Customize your form fields with Bootstrap 3 input groups

Currently, I am working on implementing a bootstrap 3 input group, but unfortunately, the outcome is not meeting my expectations. My goal is to create a select [input]-[input text]-[button] structure all in one line. However, in my scenario, the button has ...

tips for positioning images and text in the center using css classes

Here's what I currently have: http://jsfiddle.net/nCs88/ Here's my goal: As a beginner, I am struggling to center the button images with the text. Any help would be greatly appreciated as this has been frustrating me for hours. ...

In Internet Explorer 8, the PNG image is visible but in IE7, it myster

I have been trying to showcase a logo (PNG created in Paint.NET) on my website (XHTML 1.0 Transitional), using the following code: <body> <div class="header"> <div class="logo"> <img src="logo.png" /> </div> ...

Creating a stunning visual effect by using CSS to fade images in and out

My current issue involves a UX switch that controls the effect on and off of pictures. http://plnkr.co/edit/JcPXpP0jE5GysBbZbrkp I am trying to achieve a smooth fade transition from one picture to another over 1 second, but I am encountering difficulties ...

Troubleshooting the issue of CSS animations activating twice and causing a flickering effect specifically in the Firefox browser

I am facing an issue with CSS animations in Firefox. When I try to slide in some radio buttons upon clicking a button, the animation seems to be firing twice in Firefox while it works fine in Chrome. I have attempted several solutions but haven't been ...

Arranging Radio Buttons in a Row and Aligning a Radio Input Group Side by Side using Bootstrap 5

"I'm having a little issue with aligning radio buttons and a radio input group inline on the same line. The input group keeps moving to a new line for some reason. Can anyone help?" Below is the code snippet: <div class="d-flex flex ...

Steps to open and configure a Mobile-Angular modal from another controller

Is it possible to use a modal in Angular JS for mobile devices without compromising the layout? I'm having trouble setting up the controller for my modal inside my main controller and passing parameters. Should I consider using ui-bootstrap for this p ...

Troubleshoot: Trouble with selecting the clicked item in AngularJS when using ng-repeat

Is there a way to only delete the selected item from my ng-repeat list instead of deleting all items at once? I can currently delete all items using ng-repeat, but I want to be able to delete just the clicked item. How can I achieve this? https://i.stack. ...

Ways to create a distinct highlight for the selected link in the navigation upon clicking

Similar Inquiry: How can I highlight a link based on the current page? Situation I have been struggling to keep a selected link in my navigation menu highlighted after it has been clicked. Unfortunately, I haven't come across any straightfor ...

Updating the background SVG display in JavaScript/React according to the current state value

I am currently immersed in a project for my Bootcamp that involves creating a functional product with an aesthetically pleasing front end. I have chosen to utilize a .SVG as the background, set via CSS, and have successfully managed to alter the displayed ...

Please input the number backwards into the designated text field

In my react-native application, I have a TextInput where I need to enter numbers in a specific order such as 0.00 => 0.01 => 0.12 => 1.23 => 12.34 => 123.45 and so on with each text change. I tried using CSS Direction "rtl" but it didn' ...

Tips for choosing the ancestor's ancestor in CSS

<div id="maincontent"> <div id="content"> <div id="admin"></div> </div> </div> Looking for a CSS rule that will target #maincontent only when #admin is present? I have a background color set in the admi ...

Combining the devexpress dxDataGrid with Angular's $scope for seamless web development

I'm encountering difficulties with binding $scope in angular and dxDataGrid. Utilizing the devexpress library dx.all.js, which enhances the dxDataGrid with various features, I have a div for dx-data-grid and attempting to transfer the selected row da ...

AngularJS providing visual indication for processing server requests

What is the proper Angular approach to indicate to the user that the application is waiting for a response from the server? I currently have a factory with the following code: app.factory('MyAppFact', ['$http', '$q', functi ...