Safari IOS presents a display issue when using fx-layout="column" for Flex layout

We are currently utilizing Angular for the front-end with fx-layout API for responsiveness.

Whenever we employ fxLayout="column", all elements collapse and appear to have no height.

What is the recommended approach when using fx-layout/flex to address these situations?

Currently using Angular 9.0.0rc in conjunction with flex-layout": "^8.0.0-beta.27

Browserslist configuration:

0.5% last 2 versions Firefox ESR not dead # IE 9-11

Image from iOS Safari (12) can be viewed here

https://i.sstatic.net/PsPPM.jpg

Image from Chrome can be seen here

https://i.sstatic.net/CZgH2.jpg

This is the repeated container that displays the list shown in the images above

<div *ngIf="!(dataSource.loading$ | async)">
<mat-card class="pointer mb-2" *ngFor="let quotation of dataSource.quotations$ | async"
(click)="onClickRow(quotation)">
<mat-card-content fxLayout="row" fxLayoutGap.gt-xs="15px" fxLayout.xs="column" fxLayoutAlign="start center"
fxLayoutAlign.xs="center center">

  <div fxLayout="column" fxLayoutAlign="center center">
    <img class="profile-picture" *ngIf="authSvc.currentUser.hasSalesRights && quotation.customer.photoUrl"
    [src]="quotation.customer.photoUrl" alt="">
    <img class="profile-picture" *ngIf="authSvc.currentUser.hasCustomerRights && quotation.salesRep.photoUrl"
    [src]="quotation.salesRep.photoUrl" alt="">
    <img class="profile-picture" *ngIf="authSvc.currentUser.hasSalesRights && !quotation.customer.photoUrl"
    src="https://storage.googleapis.com/edcommerce/businesslogic/images/placeholder/avatar.jpg" alt="">
  </div>

  <div fxLayout="column" fxFlex fxLayoutAlign.xs="center center">
    <div fxLayout="row" *ngIf="authSvc.currentUser.hasSalesRights">
      <span class="mat-body">{{quotation.createdDate | edDate}}</span>
    </div>
    <div fxLayout="row" fxLayoutAlign.xs="center center">
      <span class="mat-h2 m-0">{{quotUtils.getVehicleDescription(quotation)}}</span>
    </div>

...

Answer №1

Encountering an issue with safari specifically on this particular element (second container in the mat-card-content):

<div fxLayout="column" fxFlex fxLayoutAlign.xs="center center">

When viewing the flex property in Safari, it displays as a strange exponential number in the CSS such as: flex: 1 1 1.12e-16

By substituting fxFlex with fxFlex="grow", the resulting css flex in Safari is now: 1 1 100%, successfully resolving the height issue!

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

CSS: Handling Background Images Responsively

I'm experiencing an unusual issue where the image is not appearing, even though the div box shows up when I highlight elements on the page. Validation and inspection also show no issues. Here is the code: <div class="mainImage"></div> A ...

What is the process of choosing an option from a dropdown menu in a Flutter application

Having an issue with my Dropdown implementation where the data is fetched from an API. The data populates successfully in the dropdown, but upon selecting an item, I encounter this error message. Can anyone provide assistance on how to resolve this? Error ...

Creating a drop-down menu within an HTML table along with a D3 bar chart

How can I implement a drop-down menu allowing the user to choose a time interval for this HTML table and d3 bar chart? The time intervals needed are: Now, 24 hours, 48 hours, 72 hours, 1 week, and 1 month. I am relatively new to creating dynamic tables and ...

Label positioning for checkboxes

Is there a way to display the checkbox label before the actual checkbox without using the "for" attribute in the label tag? I need to maintain the specific combination of the checkbox and label elements and cannot use nested labels or place other HTML elem ...

Iterating over a JSON array using *ngFor

Here is the JSON structure that I have: { "first_name": "Peter", "surname": "Parker", "adresses": { "adress": [{ "info1": "intern", "info2": "bla1" }, { "info1": "extern", "info2": "bla2" }, { "info1": " ...

What is the best way to maximize vertical space in every element on a page?

How can I achieve a layout similar to the image shown? I want three distinct sections: a navigation bar fixed at the bottom, and left and right sides each taking up 50% of the screen. Additionally, all boxes on the left side should have equal height. I am ...

Unable to establish a connection with the server data in pusher.js

I have been trying to set up a collaborative drawing application by following this tutorial. Although I have managed to run the application, the collaborative drawing feature is not working as expected. I have correctly configured the PUSHER_APP_ID, PUSHER ...

Is there a problem with animation in Css?

https://i.sstatic.net/OINsU.png Issue with Animated Div I am working on an animated div where the red background expands to the left, then shrinks to reveal an image and text. However, I am facing a problem where at the end of the animation, the right col ...

CSS designs that adapt with the screen: Triangles in

I'm currently working on creating a responsive triangle using CSS. I want both the height and width of the triangle to adjust as the window size changes. Below is my static code: #triangle { z-index: 2; width: 0; height: 0; position:absolute ...

Is it possible to test an uninitialized pointer for a static class type in Objective-C?

My current objective is to accomplish something similar to the following: within object A: UITableViewController *viewController; [someObjectB setupView: viewController]; within object B: -(void) setupView:(UIViewController*)view { if the passed-i ...

Error in the Decimal Format of NSNumberFormatter

I am looking to format a textfield that only accepts numbers to display a maximum of 3 significant figures and 2 decimal places. I want to maintain the original value of the number and only change how it appears on the screen. Currently, I am manually trun ...

Updating an item in the redux state is triggering a never-ending loop, leading to a browser

EXPECTED OUTCOME: My goal is to modify a value in my redux state ISSUE: I am encountering an issue where there is an infinite loop or the browser gets locked down. Despite consulting this Stack Overflow post and the official documentation, I am struggling ...

Disallowing selection on input text field

I am seeking to disable selection on an input field while still allowing for focusing, with the following criteria: Preventing selection via mouse Preventing selection via keyboard (including Ctrl+A, shift+arrows) Permitting focus on the field using both ...

Issue: Unable to locate a matching object '[object Object]' of type 'object'. NgFor can solely bind to data structures like Arrays and Iterables

I am facing an error that says "Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays." I am trying to create a Notification list but I can't figure out w ...

The arrangement of columns is not correctly aligned

My website layout is giving me trouble. I want to create a three column design, but unfortunately, it's not aligning properly. Each subsequent column is being pushed down slightly more than the previous one. Is there any way to fix this issue? Interes ...

Having difficulty launching Appium with a real iOS device on version 1.5.3

Previously, I had no issues starting Appium with iOS real devices. However, recently I have been unable to do so. Here is my current environment: Appium 1.5.3 XCode 7.3 iOS 9.1 I am using selenium and io.appium as shown below: <dependency> ...

Starting the device_id initialization process in CocoaLibSpotify

Our app incorporating the Spotify Wrapper CocoaSpotifyLib was recently rejected by Apple's MFI team due to the library attempting to access the device_id. Upon further investigation within the CocoaLibSpotify Xcode project, we discovered a declaratio ...

Unable to view images on Wordpress theme

I am currently facing an issue where some images in my asset folder are not displaying properly when I convert my HTML/CSS/JS template to Wordpress. The main problem is with the image that should show up when you first visit the website. Below is the CSS c ...

Maintain image proportions in CSS while rendering

Let's solve a simple CSS challenge: Your task is to display animal pictures in the grey box as seen in the example below The image size should be 150x150 pixels Keep in mind that the aspect ratio of the image must be maintained, so not all of it wil ...

Use a mock HTTP response instead of making an actual server call in Angular 4

I am facing a scenario where I have a function myFunc() that I subscribe to. When this function is called with X parameter, I expect a regular HTTP response from the server. However, if it is called without the X parameter, I want it to return a 'mo ...