question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dialog: background doesn't fit 100vh when safari's address bar is minimized on iOS 15.x

See original GitHub issue

What happened?

The address bar of safari on iOS 15.2.1 can be in a minimized state which affect the display of the shadow background when a Dialog is opened: the background doesn’t take all the height of the viewport:

ios-15-minimized

As we can see, the background doesn’t take 100vh, but instead let a space of the height of the adresse bar maximized:

ios-15-ok

What did you expect to happen?

The background must fit to take all the height of the viewport.

Reproduction URL

https://quasar.dev/quasar-plugins/dialog#example--basic

How to reproduce?

  1. On a mobile device with Safari and iOS > 15, go to the Dialog component documentation
  2. Scroll the page to have the adresse bar minimized, and open a basic dialog from the examples.
  3. The background should not fit the height of the viewport

Flavour

Quasar CLI (@quasar/cli | @quasar/app)

Areas

Components (quasar)

Platforms/Browsers

Safari, iOS

Quasar info output

Operating System - Linux(5.13.0-27-generic) - linux/x64
NodeJs - 16.3.0

Global packages
  NPM - 7.15.1
  yarn - 1.22.17
  @quasar/cli - 1.2.2
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.4.11 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app - 3.2.9 -- Quasar Framework local CLI
  @quasar/extras - 1.12.4 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.27 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.0.12
  vuex - 4.0.2 -- state management for Vue.js
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  @babel/core - 7.15.5 -- Babel compiler core.
  webpack - 5.62.1 -- Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  webpack-dev-server - 4.7.3 -- Serves a webpack app. Updates the browser on changes.
  workbox-webpack-plugin - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  typescript - 4.5.4 -- TypeScript is a language for application scale JavaScript development
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Relevant log output

No response

Additional context

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
thexeoscommented, Jan 27, 2022

We have a chat with Quasar Layout and <q-footer> with message composer “working” in Safari and WKWebView.

It can never be perfect until they fix Safari, but this may (or may not) help:

diff --git a/node_modules/quasar/src/plugins/Screen.js b/node_modules/quasar/src/plugins/Screen.js
index 3eef4ea..3dbbcfb 100644
--- a/node_modules/quasar/src/plugins/Screen.js
+++ b/node_modules/quasar/src/plugins/Screen.js
@@ -62,8 +62,8 @@ export default defineReactivePlugin({
 
     this.__update = force => {
       const
-        w = window.innerWidth,
-        h = window.innerHeight
+        w = window.visualViewport !== void 0 ? window.visualViewport.width : window.innerWidth,
+        h = window.visualViewport !== void 0 ? window.visualViewport.height : window.innerHeight
 
       if (h !== this.height) {
         this.height = h

This was not the only change I’ve made, but without this, anything else I did had no effect.

0reactions
raiikacommented, Nov 3, 2022

not sure how to test in codepen, but here https://codepen.io/raiika/full/qBYzJgM

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does Safari 15 finally fix viewport height? - Luke Channings
The main crux of the issue is that Mobile Safari's UI Chrome shrinks when you scroll, and expands again when you activate it....
Read more >
iOS 15 minimized address bar issue with fixed position, full ...
I have recently faced the same problem, when setting the body position to fixed to block scrolling while an overlay is displayed.
Read more >
About the problem of the dialog ge… | Apple Developer Forums
StespsToReproduce: (1) Display the dialog in the state where the address bar and tab of safari are not displayed on iOS15. (2) Press...
Read more >
Addressing the iOS Address Bar in 100vh Layouts - Medium
Dynamically updating the height was not working, we had a few choices: drop viewport units on iOS, match the document size like before...
Read more >
How To Prevent Scrolling The Page On iOS Safari 15 - PQINA
Nope. This is not going to work. On iOS 100vh is always the full height of the viewport, even if the footer shows....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found