message: Make popup recalculate position if necessary
diff: @@ -34,10 +34,18 @@ export class PopupViewModel {
  this.showSubscription = ko.computed(() => {
  const rect = targetElement.getBoundingClientRect();
  - const height = (<HTMLElement>this.container.children[0].children[0])
  - .offsetHeight;
  - const width = (<HTMLElement>this.container.children[0].children[0])
  - .offsetWidth;
  + const popupContainer = <HTMLElement>(
  + this.container.children[0].children[0]
  + );
  +
  + this.popupDirection(
  + PopupUtils.calculatePopupDirection(verticalPosition, horizontalPosition)
  + );
  +
  + if (this.isVisible()) {
  + do {
  + var height = popupContainer.offsetHeight;
  + var width = popupContainer.offsetWidth;
  const pos = PopupUtils.calculatePosition(
  rect,
  height,
  @@ -49,11 +57,6 @@ export class PopupViewModel {
  this.left(pos.left);
  this.top(pos.top);
  - this.popupDirection(
  - PopupUtils.calculatePopupDirection(verticalPosition, horizontalPosition)
  - );
  -
  - if (this.isVisible()) {
  if (this.showPointer) {
  this.pointerTarget(
  PopupUtils.calculatePointerTarget(
  @@ -65,6 +68,10 @@ export class PopupViewModel {
  )
  );
  }
  + } while (
  + popupContainer.offsetWidth != width ||
  + popupContainer.offsetHeight != height
  + );
  this.onShow();
  } else {
  this.onHide();
  