@kirbydesign/designsystem 11.11.1 → 11.11.2-dev-3bf0cbb
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/fesm2022/kirbydesign-designsystem-modal.mjs +7 -2
- package/fesm2022/kirbydesign-designsystem-modal.mjs.map +1 -1
- package/fesm2022/kirbydesign-designsystem-page.mjs +18 -0
- package/fesm2022/kirbydesign-designsystem-page.mjs.map +1 -1
- package/package.json +2 -2
- package/types/kirbydesign-designsystem-modal.d.ts +1 -0
- package/types/kirbydesign-designsystem-modal.d.ts.map +1 -1
- package/types/kirbydesign-designsystem-page.d.ts +3 -0
- package/types/kirbydesign-designsystem-page.d.ts.map +1 -1
|
@@ -612,10 +612,15 @@ class ModalWrapperComponent {
|
|
|
612
612
|
this.toggleContentMaxHeight(this.keyboardVisible);
|
|
613
613
|
this.setKeyboardOverlap(keyboardHeight);
|
|
614
614
|
}
|
|
615
|
+
// Fall back to the live viewport height: initialViewportHeight (from a body ResizeObserver) is 0 in Ionic apps.
|
|
616
|
+
getViewportHeight() {
|
|
617
|
+
return this.initialViewportHeight || this.windowRef.nativeWindow.innerHeight;
|
|
618
|
+
}
|
|
615
619
|
getKeyboardOverlap(keyboardHeight, element) {
|
|
616
|
-
|
|
620
|
+
const viewportHeight = this.getViewportHeight();
|
|
621
|
+
if (keyboardHeight <= 0 || !element || !viewportHeight)
|
|
617
622
|
return 0;
|
|
618
|
-
const elementDistanceAboveBottomOfScreen = Math.floor(
|
|
623
|
+
const elementDistanceAboveBottomOfScreen = Math.floor(viewportHeight - element.getBoundingClientRect().bottom);
|
|
619
624
|
return Math.max(keyboardHeight - elementDistanceAboveBottomOfScreen, 0);
|
|
620
625
|
}
|
|
621
626
|
setCssVar(element, property, value) {
|