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

Chrome iOS incorrectly displays a website when new tab #46

Open
pobch opened this issue Feb 14, 2023 · 0 comments
Open

Chrome iOS incorrectly displays a website when new tab #46

pobch opened this issue Feb 14, 2023 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@pobch
Copy link
Owner

pobch commented Feb 14, 2023

To reproduce this bug, all conditions below need to be met.

  1. Use iPad (iOS)
  2. Use Chrome. Other browsers, e.g. Safari, Firefox, are working fine.
  3. Open the website by clicking a link and open a new tab (<a target="_blank"/>). Directly type the url in address bar or reload the page will not reproduce the bug.

Steps:

  1. On iPad, open Chrome
  2. Go to www.crispyscript.com
  3. Click the top-right menu on the nav bar.
  4. Click the link "Create Diagram"
  5. Diaaagram website should be open in the new tab
  6. BUG: There is not any buttons on the bottom of the website

Possible solution:

Actual solution: We need to combine all of the following techniques

  • Use min value between window.innerHeight and document.documentElement.clientHeight instead of rely on pure document.documentElement.clientHeight
    • Why?: document.documentElement.clientHeight return a wrong value. It shows a static value which is the content height + the URL bar. Whereas, window.innerHeight shows a dynamic value depending on there is the URL bar or not.
  • Revise UX, force a user to click the adjust screen button at first visit
    • Why?: window.innerHeight will show the correct value only after the first resize event occurs. The mechanism of opening a new tab is:
      1. The website is loaded in a new tab. The URL bar appears. window's load event is triggered.
      2. At this stage, window.innerHeight = document.documentElement.clientHeight = the content height + the URL bar
      3. The window's resize event is triggered rapidly
      4. At this stage, window.innerHeight = the content height. Whereas, document.documentElement.clientHeight = the content height + the URL bar
      5. We want to use the content height. Alternative solution is to listen to window's resize event, but in that case we need to handle the resize event that is triggered from a soft keyboard?
@pobch pobch added the bug Something isn't working label Feb 14, 2023
@pobch pobch changed the title Chrome iOS incorrectly displays a website at first load Chrome iOS incorrectly displays a website when new tab Feb 14, 2023
@pobch pobch added the documentation Improvements or additions to documentation label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant