@klodd/ds 3.14.2 → 3.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/pwa-register.js +16 -24
- package/package.json +1 -1
package/js/pwa-register.js
CHANGED
|
@@ -62,28 +62,22 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/*------------------------------------------------------------
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Probe + remove ar mer palitlig an att lasa computed style pa
|
|
73
|
-
.bottom-nav direkt - en frasch fixed-element pa varje event
|
|
74
|
-
tvingar layout regardless av cache-state.
|
|
75
|
-
|
|
76
|
-
Trippel-event-binding tacker alla cold-start-cases:
|
|
77
|
-
- DOMContentLoaded: tidigt efter document parsing
|
|
78
|
-
- load: efter att alla resurser (font, splash, etc.) laddats
|
|
79
|
-
- pageshow: iOS bfcache-restore (back/forward, switch tabs)
|
|
65
|
+
Cold-start scroll-guarantee (iOS PWA)
|
|
66
|
+
Om dokumentet inte ar scrollbart vid initial load triggar iOS
|
|
67
|
+
Safari aldrig en full viewport-stabilisering, vilket bl.a.
|
|
68
|
+
resulterar i felresolvad env(safe-area-inset-bottom). Fix: lagg
|
|
69
|
+
tillfaligt en padding-bottom som gor sidan scrollbar med 1px.
|
|
70
|
+
iOS stabiliserar sin viewport. Padding tas bort vid forsta
|
|
71
|
+
scroll-event sa layouten ar tillbaka till normal.
|
|
80
72
|
------------------------------------------------------------*/
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
function ensureScrollable() {
|
|
74
|
+
if (doc.documentElement.scrollHeight <= root.innerHeight) {
|
|
75
|
+
doc.documentElement.style.paddingBottom = (root.innerHeight + 1) + 'px';
|
|
76
|
+
root.addEventListener('scroll', function cleanup() {
|
|
77
|
+
doc.documentElement.style.paddingBottom = '';
|
|
78
|
+
root.removeEventListener('scroll', cleanup);
|
|
79
|
+
}, { once: true });
|
|
80
|
+
}
|
|
87
81
|
}
|
|
88
82
|
|
|
89
83
|
/*------------------------------------------------------------
|
|
@@ -97,7 +91,5 @@
|
|
|
97
91
|
|
|
98
92
|
registerSW(cfg);
|
|
99
93
|
|
|
100
|
-
doc.addEventListener('DOMContentLoaded',
|
|
101
|
-
root.addEventListener('load', forceSafeAreaOnNav);
|
|
102
|
-
root.addEventListener('pageshow', forceSafeAreaOnNav);
|
|
94
|
+
doc.addEventListener('DOMContentLoaded', ensureScrollable);
|
|
103
95
|
})(typeof window !== 'undefined' ? window : globalThis, document);
|