I am looking for the equivalent to cypress scrollTo bottom so that I can load all of the lazy loaded content prior to taking a screenshot.
Related
Iframe automatically goes full screen using Ionic 3.9.2 on iOS.
I've tried removing all the fullscreen tags. I notice that it is not happening anywhere else. Only happens on iOS. On other devices, I have to manually make it full screen.
Why does Iframe automatically go full screen on iOS?
<iframe src="https://d1mlukbqb3dh9w.cloudfront.net/PortraitCourse/Module01/Module01Section1/story.html" height="655" width="100%"></iframe>
A while ago I would have been able to provide you with a spot-on answer. Unfortunately I no longer have access to the resources I would need to do so... meaning my answer won't be a complete solution.
IFRAME, on iOS, works slightly differently than on Android. Getting an IFRAME to take only the height you want is not simply a matter of setting the HEIGHT property on the tag as the rendering engine works differently. You'll have to play around with CSS both in the container of the tag and in the contents of the body itself.
Try proceeding as follows:
prepare a mock target page that doesn't take all the height, make
its background red and see how much space it takes
make the mock page longer than the height of the screen by adding lots of text and images to it and observe the change
wrap the IFRAME in a DIV and set the style=height: xxx of the div, as well as its overflow.
wrap the contents of the mock page in a div, setting its height, overflow, position and display style
properties to control its appearance.
repeat step (4) with both the HTML and BODY tags of the mock page.
Playing with these in real-time using Safari to alter their values will prove most useful. It was to me at least, when I had the problem over an year ago.
I have the following Grid showing Java system properties:
systemPropertyGrid = new Grid<>();
systemPropertyGrid.setItems(buildSystemProperties());
systemPropertyGrid.addColumn(SystemProperty::getProperty).setHeader("Property").setFlexGrow(1);
systemPropertyGrid.addColumn(SystemProperty::getValue).setHeader("Value").setFlexGrow(5);
systemPropertyGrid.setHeight("500px");
All items are shown when I replace the setHeight by setHeightByRows(true). But as soon as I don't specify systemPropertyGrid.setHeightByRows(true) the grid has a calculated height of 2 pixels in the browser (Firefox, Edge) which is the border. However, the element style height is correctly set to 500px as I can see in Firefox developer tools.
Bug in Vaadin Flow? How is this even possible that the browser doesn't use the element style height ultimately?
Screenshot:
SSCCE using the Vaadin Flow spring starter:
my-starter-project_51443246.zip. Call maven goal springBoot:run.
You are right. It doesn't work in Firefox, while it works in Chrome. You can submit an issue in GitHub.
As a workaround, if you set the height of the parent VerticalLayout, it works in both Chrome and Firefox. So, add the following statement:
setHeight("500px");
Fixed in Vaadin Grid v5.0.5 which has been released as part of Vaadin 10.0.9 or Vaadin 11.0.4. So you need to make sure to use either of those. (which of course wasn't released at the time of the original posting)
I'm attempting to embed a WebView into a BorderPane as it's middle component. My app starts initially in an unmaximized mode. If I maximize the application, the webview will resize accordingly, but the html & css content will not fill the whole area (it is centered in the WebView). How would I go on fixing this? I've tried to call impl_reapplyCss() and friends, but nothing seems to help.
Edited:[All the following happens even on stock IOS browser]
I have a UiWebView which load a local HTML page.
The content of the page is managed dinamically by JS, so it may grow or shrink vertically.
The layout is:
<div id="myContainer">
Some text here
</div>
The text-content may grow up to require vertical scroll, and everything is working fine.
Whenever i load new content, I use:
container.innerHTML = '';
container.appendChild(newContent);
Again, everything is fine.
The problem came when i scroll the page vertically: if I load a big content, the scroll is managed correctly, but then I load a small content and the page keeps the same big size set by the big content, with a lot of unused blank space at the end.
If i don't ever try to scroll the page vertically, the problem don't shows up (eg. i load the big content, I don't scroll, then I load the small content => the scroll is fine and page is shrinked to the latter). That's quite weird, I think something may be broken in the ScrollView logic or in the Webkit engine.
I already tried by using timeouts between innerHTML = '' and appendChild.
No luck here.
I'm experiencing this problem just on IOS stock browser & UiWebView, not on any desktop browser nor Android mobile browser / WebView.
Could anyone help?
Thanks
Edit:
Reloading the UiWebView by browsing a blank URL or anything else is not an applicable way in this case: my app is fully JS and I definitely cannot restart the app each time.
Finally, i came across a fix for this, I post here so that it may help someone other. The problem was about the containing div that won't shrink. I just set height of the container to zero while changing its content, and it return to correct size:
container.innerHTML = '';
container.style.height = '0px';
container.appendChild(newContent);
I've observed this on iOS 4.3 to 5.0. When you create a even a simple offline web app, meaning one HTML file + few assets such as CSS and JS (all present in the cache manifest), it works offline (I tested in Airplane Mode) – BUT, when you add such an app to your home screen and open it in fullscreen mode, it first displays initial content, then everything disappears (page becomes white) for half a second or more, then content reappears again.
You can see this by adding Glyphboard, a well-known and useful offline web app, to your iOS home screen and launching it a few times. You should see the white flash effect every time you load it.
This is a big problem because it gives away the non-nativeness of an app and gives the impression that the app is non-optimized for performance and buggy.
I've tried finding reports about this but all I can find is rumors and misconceptions about the iOS 4.3 JavaScript rendering engine fiasco, which doesn't need at all be related to this issue. But in iOS version 3 I distincly remember not ever seeing the white flash.
Clearing the screen and other artifacts while rendering is a common issue of HTML rendering due to the progressive nature of HTML. The concept is that the browser should draw as early and often as possible and render styles/scripts/content as they become available. It's possible the markup has an issue where all rendering is delayed until some content or a script is available. This could happen if:
You have dynamic heights based on image dimensions but you haven't
set the image dimensions in the markup or CSS.
Your layout is based on tables and you aren't using 'table-layout:fixed` in CSS.
Your HTML uses inline scripts with document.write().
You have some kind of onLoad() function that reveals/modifies content.
You link to an external stylesheet.
You're using uncacheable external content or you've disabled caching.
You're using external content that's returning 404 or isn't available offline.
Has your HTML/CSS changed between testing IOS versions?
I've found this to be caused by the use of:
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0">
With a minimal page, I get a white flash between the apple-touch-startup-image and the page contents if I use the viewport meta tag. If I take out the tag, no flash.
It's possible to work around the problem by setting the tag programatically.
I think what happens here is that iOS takes a screenshot from the page when it is added to the main menu. Then this screenshot is displayed during the application loads (WebKit loads). WebKit starts rendering the page and the page itself is constructed in such a way that the page content is not instantly available, leading to a white flash which is a rendered page when page content is not yet there,
You can avoid the problem to a certain level by building your JS/CSS so that it loads the initial HTML view fast and then lazily loads / builds the rest of the resources on the background. Also you can set a custom loading screen instead of the default screenshot iOS uses from the page.
Maybe if you can take yourself a screenshot of your app and then have something like this:
<body style="background: white url('my-initial-loading-screen.png')" />
... and make sure image is available and comes from manifest.
Or even better, have loading screen which does not require any external resources to show (just plain HTML) so you know the browser doesn't need to load anything.