Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 50bfe35

Browse files
fix: iOS and screen/window width detection
1 parent bde515f commit 50bfe35

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

webcomponents/core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<a name="1.0.0-beta.44"></a>
22
# 1.0.0-beta.44 (Not released yet)
33

4+
### Fix
5+
6+
* on iOS sometimes `screen.width` is the property to use to determine the screen size, sometime it's `window.innerWidth` ([#212](https://github.com/deckgo/deckdeckgo/issues/212))
7+
48
### Features
59

610
* handle Youtube short URL ([#204](https://github.com/deckgo/deckdeckgo/issues/204))

webcomponents/core/src/components/deck/deckdeckgo-deck/deckdeckgo-deck.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ export class DeckdeckgoDeck {
118118
}
119119

120120
if (DeckDeckGoUtils.isIOS()) {
121-
slider.style.setProperty('--slide-width', '' + screen.width + 'px');
121+
slider.style.setProperty('--slide-width', `${screen.width > window.innerWidth ? screen.width : window.innerWidth}px`);
122122
} else {
123-
slider.style.setProperty('--slide-width', '' + window.innerWidth + 'px');
123+
slider.style.setProperty('--slide-width', `${window.innerWidth}px`);
124124
}
125125

126126
resolve();

0 commit comments

Comments
 (0)