fullPage.js icon indicating copy to clipboard operation
fullPage.js copied to clipboard

Page height miscalculated in ios15

Open callihiggins opened this issue 3 years ago • 17 comments

Description

In Safari in ios15, the url bar was moved to the bottom of the page. I'm now seeing that the page height for a full page "section" is miscalculated. When the url bar minimizes itself, page heights are miscalculated and are no longer full viewport.

Link to isolated reproduction with no external CSS / JS

This can be reproduced on the library's demo page: https://alvarotrigo.com/fullPage

IMG_EF91C4E9AB36-1

IMG_9658

Steps to reproduce it

  1. Open the demo page on an iPhone running ios 15
  2. Scroll so that the tool bar minimizes itself (you may need to select "Hide toolbar" from the menu to see this on the demo page. In my project, the toolbar hides itself on a scroll)
  3. Observe the bottom space resulting from the page height calculation being too short

Versions

Safari, ios15, iPhone

callihiggins avatar Dec 08 '21 19:12 callihiggins

same

ghost avatar Dec 13 '21 12:12 ghost

Mmm I haven't tested it yet as I need to update my iPhone, but it seems like Apple changed the way they deal with toolbars... on the previous version the toolbar wouldn't hide unless the scroll bar was enabled on fullPage.js. (Which is not on the demo page unless using a very small viewport size)

alvarotrigo avatar Dec 13 '21 15:12 alvarotrigo

I should note that my project does have the scroll bar enabled, which auto hides the toolbar and makes the miscalculated height extra apparent as soon as someone scrolls.

callihiggins avatar Dec 13 '21 20:12 callihiggins

I should note that my project does have the scroll bar enabled,

Yeah, that's actually the surprising part. Without scrollbar, iOS didn't hide or reduce the toolbars before.

alvarotrigo avatar Dec 13 '21 22:12 alvarotrigo

Previously, in the event that the scroll bar is enabled and therefore the toolbar comes and goes, what is the preferred way of dealing with the height miscalculation?

callihiggins avatar Dec 14 '21 18:12 callihiggins

@callihiggins iOS didn't hide or minify the toolbars when not using a scroll bar. They stayed the same size all the time, as fullPage.js doesn't really "scroll" the page but simulates the scroll by using translate3d CSS properties.

alvarotrigo avatar Dec 14 '21 18:12 alvarotrigo

Hello Álvaro, I got the same issue, setting fullPage with scrollBar true or false doesn't change much. I tried to use the "afterResize" call back, but it looks like our "beloved" Safari does not trigger that callback when hiding the bottom navbar. Also tried to force resizing the sections height both on afterLoad and onLeave but it messes up everything.

paperplanefactory avatar Dec 22 '21 09:12 paperplanefactory

I'll try to take a look at it these days.

alvarotrigo avatar Dec 22 '21 13:12 alvarotrigo

Die someone come up with a workaround?

YugoCode avatar Dec 31 '21 01:12 YugoCode

This is still an issue has someone discovered a workaround for this?

Update: In my case, it was my own error. I had some leftover styling on the interior divs with heigh: 100vh, which was interfering.

kylepfeeley avatar Jan 06 '22 17:01 kylepfeeley

This is still an issue has someone discovered a workaround for this?

Update: In my case, it was my own error. I had some leftover styling on the interior divs with heigh: 100vh, which was interfering.

This worked for me. Changing height: 100vh to height: 100% did the trick.

KinIcy avatar Jun 16 '22 18:06 KinIcy

This is still an issue has someone discovered a workaround for this? Update: In my case, it was my own error. I had some leftover styling on the interior divs with heigh: 100vh, which was interfering.

This worked for me. Changing height: 100vh to height: 100% did the trick.

I assume you were using fullPage.js version 3.

Version 4 already uses 100vh so probably this issue doesn't take place any more. I just haven't closed the issue as I haven't tested it out yet.

alvarotrigo avatar Jun 16 '22 18:06 alvarotrigo

Hi, i'm using fullPage for Elementor and i have the same issue with Safari. Like this issue creator, i also can confirm the same error happens with the examples on the Demo library of the plugin's website. This error does not happen on Chrome, though.

Any ideas how to correct this? Thanks.

~~EDIT: by disabling the anchors on the plugin's settings, i was able to solve this.~~

mentolnet avatar Sep 08 '22 16:09 mentolnet

The issue is very probably solved in fullPage.js version 4. Try the latest version 4.0.11.

alvarotrigo avatar Sep 08 '22 16:09 alvarotrigo

The issue is very probably solved in fullPage.js version 4. Try the latest version 4.0.11.

Hi, thank you for that. I don't exactly understand what happened, but it seems the solution i mentioned above (disabling the anchors) stopped working, I am back at the same as before. I am using, as i said, the Elementor plugin. The version i'm using is Version 1.9.0 - seems to be the latest.

Any thoughts on this? Thanks.

mentolnet avatar Sep 08 '22 16:09 mentolnet

I am using, as i said, the Elementor plugin. The version i'm using is Version 1.9.0 - seems to be the latest.

An update is coming soon that will update the Elementor plugin to fullPage.js v4. Wait a week or so and update then :)

alvarotrigo avatar Sep 08 '22 17:09 alvarotrigo

An update is coming soon that will update the Elementor plugin to fullPage.js v4. Wait a week or so and update then :)

Thanks, Alvaro. Unfortunately this website should be launched in a couple of days. Hope the wait will not be long...

All the best.

mentolnet avatar Sep 08 '22 17:09 mentolnet