Issues with html/css compatibility have been observed on IOS devices

Here's a puzzling situation that has me scratching my head. I have created an app used to manage an eye chart in a medical office. It's a simple interface where pressing the "20/20" button displays the 20/20 line on screen. Everything runs smoothly when accessed through browsers on Android, Windows, and Mac computers. However, things take a bizarre turn when I try to run it on iOS devices. Let me illustrate with some images and code snippets.

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

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

The issue is evident in these images - upon initial load, pressing a button works as expected. For example, the left image shows proper functionality on a Samsung Galaxy S9+, while the right image depicts an iPhone 11. The problem arises when attempting to load a different line using another button; the first set of letters seems to remain stuck and does not get replaced by subsequent button presses. The JavaScript logic is straightforward: "if the '20/20' button is pressed, display specific letters... if the '20/30' button is pressed, show those letters instead." However, on iOS devices, the initial letters refuse to yield to the new ones, particularly on the right half of the division. Despite thorough inspection revealing no overlapping divs or other issues, this strange behavior persists exclusively on iOS devices. Here's the HTML markup:

<div class="lineHolder">
        <button class="singleButtons singleFilter" id="singleFilter" data-size="singleFilter">1</button>
        <button class="singleButtons retinoscopy" id="retinoscopy" data-size="retinoscopy">RS</button>
        <button class="singleButtons colorPlates" id="colorPlates" data-size="colorPlates">CP</button>
        <button class="singleButtons" id="refresh" data-size="refresh">R</button>
        <div class="lineContent text">
             <p id="line1"></p>
             <p id="line2"></p>
             <p id="line3"></p>
             <p id="line4"></p>
             <p id="line5"></p>
             <p id="line6"></p>
         </div>
    </div>

And here's the accompanying CSS styling:

.lineHolder{
    width: 100%;
    margin: 20px 0;
    border-radius: 10px;
    background-image: url('/images/logotranslucent.png'), linear-gradient(to top, #666 , #808080);
    background-position: right bottom, center top;
    background-size: 10%, cover;
    background-repeat: no-repeat;
    min-height: 150px;
    text-align: center;
    position: relative;
    display:flex;
    justify-content:center;
}
@media only screen and (max-width: 800px) {
    .lineHolder {
        background-size: 15%, cover;
    }
}

.lineContent{
    line-height: 40px;
    align-self: center;
}

.text{
    font-family: 'Sloan';
    font-size: .8em;
    line-height: 30px;
}

To clarify, the multiple <p> tags are utilized for displaying up to six lines based on user preference. With each button press, the JavaScript clears all lines and inserts the appropriate one. Omitting the JavaScript here since it functions correctly on all platforms except iOS. Therefore, I suspect there may be an underlying quirk or unusual aspect to the iOS platform causing this anomaly. Can anyone provide insight into resolving this issue?

Answer №1

Diagnosing the issue based on the provided code is challenging as there seems to be no apparent cause for the text disappearing. Your CSS and HTML appear to be fairly standard.

Here are a few things to consider:

  1. Identify which browsers you are testing in
  2. If it looks fine in an iOS emulator, try using the xcode emulator (if available)
  3. Check browser specs for consistency in CSS and javascript across different browsers

Another potential factor could be the media query in your CSS affecting how it displays on a true IOS device.

While this may seem vague, I hope it helps steer you in the right direction!

Best, Scotty

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

Fancybox fails to open when clicking on the submit form

I am having an issue with the fancybox not appearing after submitting my form. Below is the code I have for the fancybox: <div class="hidden" id="fancybox-popup-form"> (your Fancybox content goes in here) </div> <style> .hidd ...

Why does the jQuery hide function fail to work on a div with the same class after an ajax

1. I'm encountering an issue with my code. I have a div class "inner" which is being dynamically loaded via an ajax call. However, after the ajax call, if I click the hide button, it doesn't work. Strangely, it was working perfectly fine before ...

Arrange the elements in an HTML table with the first and last columns on the left and right sides

Is it feasible to have the first and last columns of an HTML table fixed while allowing the middle columns to be scrollable? (This functionality is achievable in jQuery DataTables, but what about a basic HTML table?) ...

Locating the cause of a crash using the crash report provided by Apple

I recently had my app rejected by Apple because it crashed during their testing. Unfortunately, I am unable to pinpoint the exact location of the crash in order to further debug the issue (and I have not been able to replicate the crash myself). By referr ...

What is the reason behind the change in style hierarchy when using ':last-child'?

I found myself in a confusing situation where using :last-child is affecting how parent classes are being applied. The task at hand is to style the last element in a list of elements. However, upon using :last-child, the priority of styles shifts and one ...

Display a selected portion of the background image

I'm currently facing an issue with one of the background images in my div element. The CSS I'm using is as follows: .myBox { background-image:url('....'); background-repeat:no-repeat; background-size:cover; } The background image d ...

elevate design css/widget/components

I am currently on the lookout for samples of boot strap floating css/widget/parts. Despite googling with keywords like 'floating / fixed', I have only come across sticky footer and header examples, or some simple panel samples. By 'floatin ...

Having trouble with the jQuery each function's functionality

I am creating circular counters for surveys by generating a counter for each answer option. Currently, I am utilizing this "plugin": Issue: The problem lies in the plugin not fetching the text value from the <div> element and failing to draw coun ...

Adjusting the size of the post title's font

Looking to decrease the font size of the latest post's title and keep it centered on my Jekyll based blog. I attempted to adjust https://github.com/x0v/x0v.github.io/blob/master/_sass/atoms/_feature-title.scss by adding font-size: 45px !important; f ...

Button that can be clicked even when not in the parent view

I've added a button to my view using the following frame: CGRectMake(self.view.frame.size.width - 80, -35, 60, 60) The area of the button that extends beyond the main view is not responsive to clicks... Is there a way to address this issue? ...

JavaScript will continue to process the submit to the server even after validation has been completed

My current challenge involves implementing form validation using JavaScript. The goal is to prevent the form from being sent to the server if any errors are found. I have made sure that my JavaScript function returns false in case of an error, like so: ...

Utilizing Google Maps to display an infowindow upon clicking a location from a geojson file

I want to implement info windows that pop up when markers on a map are clicked. I used the sample code provided by Google (below) to create a marker map from geojson files dragged and dropped into the window. My goal is for the info windows to show text ta ...

When the type attribute is set to "password" in Textbox, the CSS

I am new to CSS and I'm currently working on styling my Login page. Everything works fine when I keep the code as it is, but I want to change the password input field type to "password" for security reasons. However, when I do this, the CSS styles are ...

Tippy.js tooltips are not adapting to CSS styling as expected

My experience with tippy.js in my browser had been smooth until this morning. All of a sudden, they stopped responding to any CSS styling and simply defaulted to a dark grey background with border radius. However, they still respond to changes in the scrip ...

What's the best way to ensure a div's height and width are equal when implementing responsive design?

I am currently working on a responsive design and facing challenges in making div's height and width equal. Initially, I set the div's width as a percentage and height as auto, but this caused the divs to not display properly. To resolve this iss ...

After a slight delay, the animated element twitches into action

I am currently working on implementing a menu item behaviour in the header similar to the one found at: . On this webpage, there is a bar that slides back and forth when hovering over elements. However, I am unable to add another element to my header, so I ...

Improper height of MathJax in the div element

I'm currently investigating why the MathJax render block is giving me an incorrect height for the div. Here's the code snippet: <div class="text-field" id='inner-text'>\(\sqrt{b^{a}\frac{\partial y}{& ...

Incorporating external content into your website: A guide

Currently, I am in the process of developing a website for personal use (without any intention of making profit). The vision for this website is to serve as a comprehensive "directory" featuring various posts sourced from different websites - similar to a ...

Update overall font size to be 62% for a consistent look across the website

Recently, I developed a browser extension that adds an overlay button to the LinkedIn website. Everything was running smoothly until I discovered that LinkedIn uses a global font-size: 62,5% that completely messes up my design.. https://i.stack.imgur.com ...

Error in Jquery click function not being triggered

I'm in the process of developing an eCommerce platform where users can choose options and have their shopping carts automatically updated using jQuery. Users will be presented with a few radio buttons to select from, and as they make their choice, th ...