The image appears off-center on an iPad Pro when rotated to landscape mode, specifically while utilizing the Babel transpiler

There seems to be an issue with my JavaScript script that displays an image with a resolution of 2160 x 3840. When viewed on an iPad Pro in landscape mode, the image appears shifted down. You can see the problem demonstrated in the code example here.

I've tested the image display on various devices and browsers as shown in the table below. The image appears correctly on all devices including laptops, MacBooks, Android mobile phones, and iPhone 8, except for the iPad Pro. Interestingly, the image displays correctly on laptops and MacBooks in both portrait and landscape modes using Safari's Responsive Design Mode.

It's worth noting that in order to run the example on an Apple device, I had to transpile the code using Babel. When testing the example on an iPad Pro in different browsers (Chrome, Safari, and Firefox), the transpiled image is shifted (see figure1), whereas the same transpiled code runs fine on iPhone 8 (see figure2).

I am looking for recommendations on how to fix this issue or troubleshoot it further. Any help would be appreciated.

https://i.sstatic.net/qNoKc.png https://i.sstatic.net/Xoank.jpg https://i.sstatic.net/7PGsn.jpg

<!DOCTYPE html>
<html>
<head>
    <!-- ############################ -->
    <!-- using jsdelivr, with transpile -->
    <!-- NOT OK - image is shifted -->
    <!-- ############################ -->
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="Construction Overlay App">
    <meta name="author" content="Avner M.">
    <!-- <meta http-equiv="Content-Security-Policy" content="default-src *; img-src 'self' blob: https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src  'self' 'unsafe-inline' *">
       -->
<title>With transpile landscape image shifted</title>

    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f399828696818ab3c1ddc1ddc3">[email protected]</a>/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="66120907151214265448574852">[email protected]</a>/build/toastr.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/avnermosh/example12_ipad_landscape_image_not_centered_properly@master/example12_style.css">
    
</head>
<body>
    <div id="grid-container1"></div>

    <script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e2c3b393b303b2c3f2a312c732c2b302a37333b1e6e706f6d706f">[email protected]</a>/runtime.js"></script>
    <script type="module" src="https://cdn.jsdelivr.net/gh/avnermosh/example12_ipad_landscape_image_not_centered_properly@master/build/bundle2.js"></script>

    <link rel="preload" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="91e5fef0e2e5e3d1a3bfa0bfa5">[email protected]</a>/build/toastr.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
</body>
</html>

Answer №1

By updating iOS to version 14.0.1, I successfully resolved the issue at hand.
Thanks to this update, the image no longer appears shifted.
Now, the image is correctly displayed in both landscape and portrait modes.

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

Whenever I include an onClick event to a div element, the entire webpage fails to display

Currently taking on the task of developing a seat booking website. I am encountering an issue with adding an event listener to a particular div element, which should trigger a function to store the value of the div. However, upon implementing the onClick e ...

Customizing the Switch component individually for each item fetched from an API in React Native

I'm struggling with setting the switch button individually for each item in my API. Despite trying multiple solutions, none of them seem to work for me. const results = [ { Id: "IySO9wUrt8", Name: & ...

How to Fetch Byte Image with Ajax and Display it on the Client Side in ASP.Net MVC

After converting an image to bytes, I am facing the challenge of displaying the byteImage in a browser. I have two sets of data, one being the Image ID and the other being the Image_name, which are displayed in a table. However, I am unable to display the ...

What is the best way to specify the CSS :hover state within a jQuery selector?

I am trying to change the background color of a div element when hovered using jQuery, but for some reason the following code is not working as expected: $(".myclass:hover div").css("background-color","red"); Can someone provide guidance on how to achiev ...

What is the best way to initiate a Post/Get Request to NodeJS without causing a page refresh?

Struggling to run a NodeJS function after clicking a button? You're not alone. Ajax requests haven't been working for me either when it comes to running NodeJS functions. I've got a bash script that generates a JSON file which I want to par ...

Steps for adding an npm dependency as a peer dependency:

Is there a way in npm to install dependencies as peer-dependencies similar to the yarn option --yarn, rather than manually adding them? For instance: "peerDependencies": { "@angular/core": "^7.0.0" } Update: Further clarifi ...

Encountered a NodeJS error while attempting to locate information in a mongo DB: UnhandledPromiseRejectionWarning

In my MEAN stack application, I am working on implementing a login feature that includes social login functionality. When a new user attempts to log in using Facebook, I need to verify if their Facebook account is already registered in my MongoDB database. ...

Unlocking the Power of Session Variables in AngularJS using Ui-router

Currently, I am utilizing Angular to manage routes. On the server side, Passport is being used so that I can access the user session variable req.user in my views. However, when dealing with a route rendered by ui-router, my req.user ends up being undefine ...

Leveraging the Firebase email trigger extension with JavaScript

Recently, I integrated the email trigger extension for Firebase. Below is the function I am using: firestore .collection("profiledata") .doc(user.uid) .update({ accountStatus: "active", }) .then(() => { // At this p ...

Is there a pre-existing function that can handle calling a JavaScript function asynchronously after the onload event has finished

I am in need of converting a javascript function that currently uses XMLHttpRequest() to perform a synchronous data fetch from the server into an asynchronous one. The function currently caches the data received to avoid multiple fetches. However, when att ...

Utilize the controller data to display information on a day-by-day basis

In my attempt to design a weekly calendar using AngularJS, I am facing challenges when it comes to inserting events into the 7 boxes representing each day of the week on the calendar. The current HTML structure is as follows: <div class="week"> ...

In what way can I incorporate additional functions or multiple functions within an Express route to modify database information?

Currently, I am working on a project that involves Express and MySQL. One of the challenges I am facing is retrieving data from a connection.query and then utilizing that data in other functions within the same route. My goal is to use the array created in ...

Issue with the position of the search dropdown in HTML

When we click on the Dropdown option, it appears above the text instead of below. I have been trying to fix the positioning issue where the Dropdown shows up separately after clicking, but I have not been successful so far. Maybe you can offer some assist ...

Transferring data from a JavaScript variable to PHP using AJAX

I’m currently working through the tutorial at http://www.w3schools.com/php/php_ajax_database.asp and I think I have a good grasp of how it all operates. This is my code: PHP: <?php include('./db.php'); $PM = mysqli_query($con, "SELECT DIS ...

Implementing Title Attribute in Grid View Template Field

I have implemented a Grid View with a "TemplateField" that includes properties for Header Text and SortExpression set to true. Upon inspecting the browser, I noticed that it generates an anchor element with some JavaScript. How can I add a title tag to t ...

Tips on incorporating the vue package

I recently started using Vue and decided to incorporate a plugin called vue-toastr. I'm attempting to integrate it with Laravel, which already has Vue set up with the plugin. Unfortunately, I keep encountering an error that says "TypeError: Cannot rea ...

I have successfully implemented a click effect on one image and now I wish to apply the same effect to the remaining images

I've exhausted all my options and still can't crack this puzzle. Let me break it down for you: Upon entering the page, users are greeted with a collection of images each tagged with classes (for example, img01 and img02). When an image is clicke ...

Is the express.json() middleware for parsing JSON request body designed to handle synchronous calls?

According to Express.js's documentation, it is recommended to avoid using synchronous functions as much as possible. This is because in high-traffic websites, the accumulation of synchronous calls can negatively impact the performance of the applicati ...

Mastering the art of using the async pipe in conjunction with rxjs

I require assistance as the loading component of my async pipe does not activate, despite the data loading correctly. The loading template fails to trigger during subscription even though I am using a BehaviorSubject in my service. I have attempted various ...

Failure to register Express Route

I am currently using express and facing some challenges with creating routes using express.Router. Below is my index.js file (npm main file): require('dotenv').config() const express = require('express') const loaders = require('. ...