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

Does not work in iOS Chrome #26

Open
apptaro opened this issue Jun 5, 2019 · 1 comment
Open

Does not work in iOS Chrome #26

apptaro opened this issue Jun 5, 2019 · 1 comment

Comments

@apptaro
Copy link

apptaro commented Jun 5, 2019

Not working for iOS Chrome 74.0.3729.155.

This is because window.innerHeight has not been updated when an orientationchange event occurs. There is a workaround below, but I'd like to see it implemented in the library.

Workaround:

var test = vhCheck({
  onUpdate: (obj: any) => {
    orientationChanged().then(() => {
      const cssVarName = "vh-offset";
      const sizes = my.vhCheck.recompute();
      document.documentElement.style.setProperty(`--${cssVarName}`, `${sizes.value}px`);
    });
  }
});

See this for the orientationChanged function: https://stackoverflow.com/a/44579732

@Hiswe
Copy link
Owner

Hiswe commented Jun 5, 2019

@apptaro thanks for the code.
I'll be glad to see that in the code but I don't have the time right now to do it.
Can you come up with a PR?

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