@hkdigital/lib-core 0.5.34 → 0.5.35

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.
@@ -240,15 +240,23 @@
240
240
 
241
241
  function updateIosWidthHeight() {
242
242
  if (isPwa && isAppleMobile) {
243
- const angle = screen.orientation.angle;
243
+ // const angle = screen.orientation.angle;
244
+ // if( window.matchMedia('(orientation: portrait)').matches ) {
245
+ // }
244
246
 
245
- // Use screen.orientation.angle as the source of truth
246
- // angle 90/270 = landscape, angle 0/180 = portrait
247
- isLandscape = (angle === 90 || angle === 270);
247
+ switch( screen.orientation.type ) {
248
+ case "portrait-primary":
249
+ case "portrait-secondary":
250
+ isLandscape = false;
251
+ break;
252
+ default:
253
+ isLandscape = true;
254
+ break;
255
+ }
248
256
 
249
257
  // Use window.inner dimensions instead of screen dimensions
250
258
  // because screen.width/height don't rotate on iOS PWA
251
- // if (angle === 90 || angle === 270) {
259
+ // if (isLandscape) {
252
260
  // iosWindowWidth = window.innerHeight;
253
261
  // iosWindowHeight = window.innerWidth;
254
262
  // } else {
@@ -262,7 +270,7 @@
262
270
  if( debug )
263
271
  {
264
272
  console.debug('updateIosWidthHeight', {
265
- angle,
273
+ 'screen.orientation.type': screen.orientation.type,
266
274
  isLandscape,
267
275
  'window.innerWidth': window.innerWidth,
268
276
  'window.innerHeight': window.innerHeight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.34",
3
+ "version": "0.5.35",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"