As other comments suggest, setting the height at 100% solves the issue, but introduces many others. What I found out is that it is worse when the keyboard is opened and closed.
Other thing I noticed on the header of my application, which has position: fixed
but is being scrolled out of the view, is that if I get the bounding client rect the Y value is negative, so I tried something like this:
const handleScroll = () => {
const headerElement = document.getElementById("app-header");
const {y} = headerElement.getBoundingClientRect();
if (y !== 0) {
headerElement.style.paddingTop = `${-y}px`;
}
};
window.addEventListener("scroll", handleScroll);
The problem here is that after ~800px are scrolled down the Y value is 0 again but the element is still outside of the screen, so this fix becomes useless.
I see this issue affecting multiple pages, from their own apple website to this stack overflow page and basically every page with a fixed element on it, but I cannot find this issue being tracked by Apple. Is there any support page where this has been reported?