What steps can I take to fix the issue of iFrame not scrolling on IOS/iPhone?

I have set up an iFrame to display a multi-page document, but I am facing an issue where the content is static and does not scroll on iPhone devices. Below is the code snippet I am using:

   return (
      <div className="policyViewDocumentContainer">
        <AccountFlowHeader guid={guid} history={history} handleSignOut={this.handleSignOut} />
        <p className="policyViewInternalHeader">
         Card
        </p>
        <hr />
        <div className="policyViewDocumentInnerContainer">
          <object
            title="Policy Document"
            data={`https://agency.${env}api.endpoint.com/agency/policyNumber/${contractNum}`}
            type="application/pdf"
            style={{
              width: '100%',
              minHeight: 'calc(100vh - 130px',
            }}
          >
            <embed
              src={`https://agency.${env}api.endpoint.com/buckle/policyNumber/${contractNum}`}
              type="application/pdf"
            />
          </object>
          <div />
        </div>
      </div>
    );
  }
}

This code snippet only covers the render method. I suspect that I may need to make some adjustments related to webkit styling to enable scrolling properly in Safari on iPhone.

Answer №1

It's hard to pinpoint the exact issue from your code, but one common problem is iframes not scrolling on iOS. To fix this, you can add

-webkit-overflow-scrolling: touch;
to the wrapping element like so:

.scroll-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-y: scroll;
}

.scroll-wrapper iframe {
    /* ... */
}

For more details and examples, check out this link: https://davidwalsh.name/scroll-iframes-ios

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

Validating Percentages

In the project I'm working on, there is a percentage field where users can input their desired percentage. I am looking to restrict the input to valid exam percentages like 85.85, as opposed to inputs such as 100.00000 or any other format. The percent ...

Creating a three-column CSS layout with the option to toggle one column

I am attempting to design a 3-column layout in CSS with one column that can be toggled on and off. The diagram below illustrates the layout. I want all three columns to be full height. In red: A fixed-width column In green: A toggleable menu In dark gre ...

The react-router routes are failing to provide the expected results as they are not displaying any content on the webpage upon rendering

Having recently started learning React, I am currently working on implementing routes for basic navigation of components on my homepage. Although I have included the necessary code in my homepage component, I still encounter an issue where nothing appears ...

Don't forget to strip off the height attribute once the transform is

Utilizing the transform property: .parent { display: inline-flex; flex-direction: column; align-items: center; } .first { height: 100px; } .second { height: 100px; transform: translateY(-50%); } <div class="parent"> <div ...

Having difficulty with updating the session for next-auth v4 in Next.js 13

I am currently using Next.js 13 in combination with Next-Auth v4. Additionally, I have my own external Express API. My sign-in provider is Google For the login process, I make a call to an external API which provides me with access and refresh tokens. Wh ...

What causes a div element to not be 100% width when all its predecessors are already set to 100

Why are the divs not expanding with content even though everything is set to 100% and how can this issue be resolved? html, body { height: 100%; } body { margin: 0; padding: 0; } /* both of these are constrained to 100vh */ #root { height: 100 ...

Tips for ensuring my buttons are non-functional to clicks

I am looking to create buttons with the class btnd that are active but not clickable by users. You can view the current output here: http://jsfiddle.net/6VrXD/44/ ...

Position the footer at the bottom of the content and shift it to the right of the sidebar

I was aiming to position the footer at the bottom of the content, without extending it across the entire width of the page. The footer should always be aligned with the bottom if the content is not filling up the space, as illustrated in figure 1. The side ...

When adjusting the top margin of the main content in CSS, the fixed top navigation section's margin also decreases simultaneously with the main content

I am in the process of creating a basic static blog page using HTML5, SASS, and CSS. While working on the design, I utilized the 'nav' semantic element for a fixed top bar on the page that remains visible even when scrolling down. Additionally, ...

What causes alloc to fail in the applicationWillEnterForeground method?

Within both the applicationDidFinishLaunchingWithOptions and applicationWillEnterForeground methods in AppDelegate.m, I have added the following code: [MAMapServices sharedServices].apiKey = kMapKey; _mapView = [[MAMapView alloc] initWithFrame:CGRectMake( ...

Steps to fix uncaught typeerror: unable to access property 'getDisplayList' of null

encountering a similar issue like the one mentioned here: An error is occurring when utilizing the onEvents argument of Echarts to invoke an external function. How can this be resolved? interface ParamsInterface { type: "datazoom"; start ...

In the Android Chrome browser, the settings of the meta viewport attribute do not take effect when the device is in full screen mode

While using the fullscreen api in Android, I noticed that the values of meta viewport attributes like initial-scale and user-scalable are not reflected in the browser when in full screen mode. However, when not in full screen mode, these values work as exp ...

I'm facing an issue where I am unable to successfully transmit data from a JSX form in my React App to a PHP file. While the PHP file is functioning correctly,

Currently, I am using XAMPP on MacOS to host a React App frontend connected to a MySQL database with PHP. My goal is to create an ecommerce website for my university project. While everything seems to be working fine individually - Apache is up and running ...

Creating a test scenario for displaying a list of posts

I am currently working on writing a test for the code snippet below, which essentially displays all blog posts with the most recent post appearing at the top. I am fairly new to React Testing Library and each time I try to include my components in the test ...

Displaying a modal view for user sign-in purposes

I am currently working on an application that allows users to access certain tabs without logging in initially, but requires login for specific tabs. My goal is to have the login view slide up whenever these tabs are opened. If a user chooses to Cancel out ...

Looking to exclusively distribute an app via email on iOS using UIActivityViewController?

My goal is to exclusively share the content via email without displaying the message option. Can you assist me with accomplishing this? Additionally, I would like to programmatically set both the subject and recipient of the email. ...

The export button in the React Material Table doesn't seem to be displaying correctly

[I am encountering an issue with the React export button in Material Table. The bar is not showing completely. My code includes the following: options = {{exportButton:true}} How can I resolve this?]1 ...

What is the best way to format text in React without using spaces?

Here's my take on the problem: https://codesandbox.io/s/fast-smoke-bhudq. The text does not wrap as expected, instead overflowing to the right beyond "HELLO". It appears that setting a maxWidth is not working effectively. Could someone please modify ...

Swift code for a customized pull-to-refresh feature

I recently implemented code similar to the one found at in my webview project, and it's been functioning well. However, I'm now wondering how I can replace the default spinning circle with my own logo. Any suggestions? ...

Having trouble changing my array state in react?

I'm having trouble understanding why my React state isn't updating with the following code: state = { popUpMessages:[] } popUpMessage(id,name) { console.log("id ",id,"name ",name) const addUserObject = { id, name }; const new ...