@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.
@@ -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
- if (keyboardHeight <= 0 || !element || !this.initialViewportHeight)
620
+ const viewportHeight = this.getViewportHeight();
621
+ if (keyboardHeight <= 0 || !element || !viewportHeight)
617
622
  return 0;
618
- const elementDistanceAboveBottomOfScreen = Math.floor(this.initialViewportHeight - element.getBoundingClientRect().bottom);
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) {