diff --git a/src/app/Controllers/app.component.ts b/src/app/Controllers/app.component.ts index a48d1737..fd3a842a 100644 --- a/src/app/Controllers/app.component.ts +++ b/src/app/Controllers/app.component.ts @@ -16,6 +16,8 @@ import { MessageService } from '../Services/MessageService'; export class AppComponent implements OnInit, AfterViewInit { + public iosHeightFix = false; + constructor( private initService: InitService, private elementRef: ElementRef, @@ -31,6 +33,13 @@ export class AppComponent implements OnInit, AfterViewInit { Swal.close(); } + @HostListener('window:resize') + onResize() { + // in safari and the address bar is shown... + this.iosHeightFix = window.navigator.platform && /iP(ad|hone|od)/.test(window.navigator.platform) && + document.body.scrollHeight - window.innerHeight >= 50; + } + @HostListener('window:load', []) onLoad() { if ('Notification' in window && 'serviceWorker' in navigator) { @@ -65,7 +74,6 @@ export class AppComponent implements OnInit, AfterViewInit { // disable body scroll for ios if (window.navigator.platform && /iP(ad|hone|od)/.test(window.navigator.platform)) { this.homeService.updateIosDisableScroll(); - new MutationObserver(() => { this.homeService.updateIosDisableScroll(); }) diff --git a/src/app/Views/app.html b/src/app/Views/app.html index 802a4a70..025e6d2d 100644 --- a/src/app/Views/app.html +++ b/src/app/Views/app.html @@ -5,7 +5,9 @@
+
+