Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Readme > Installation section #12

Open
hardrese7 opened this issue Nov 26, 2020 · 2 comments
Open

Bug in Readme > Installation section #12

hardrese7 opened this issue Nov 26, 2020 · 2 comments

Comments

@hardrese7
Copy link

Now it uses document.documentElement.clientHeigh, however it doesn't change on show/hide status bar. In the original article they use window.innerHeight, next code works for me:

var customViewportCorrectionVariable = 'vh';
function setViewportProperty(doc) {
var prevClientHeight;
var customVar = '--' + ( customViewportCorrectionVariable || 'vh' );
function handleResize() {
    var clientHeight = window.innerHeight;
    if (clientHeight === prevClientHeight) return;
    requestAnimationFrame(function updateViewportHeight(){
        doc.style.setProperty(customVar, (clientHeight * 0.01) + 'px');
        prevClientHeight = clientHeight;
    });
}
handleResize();
    return handleResize;
}
window.addEventListener('resize', setViewportProperty(document.documentElement));
@Faisal-Manzer
Copy link
Owner

Can we have some more discussion on this?

@hardrese7
Copy link
Author

@Faisal-Manzer sure, what do you want to discuss?
I see there were the reasons why you decided to change approach #3

However, I didn't notice any zoom issues on my project.
Maybe Apple fixed something? Could you recheck zoom problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants