code: function () {
              var domReference = this.reference;
              if (domReference && this.isOpen) {
  
                  var position = this.popupContainer.calculatePosition(domReference);
                  var size = {
                      width: domReference.offsetWidth,
                      height: domReference.offsetHeight
                  };
                  var referenceIsInContainer = this.popupContainer.isInside(position, size, this.domElement);
  
                  if (referenceIsInContainer) {
                      this.referencePosition = position;
                      this.referenceSize = size;
                      this.refresh();
                      if (this.domElement && this.domElement.style.visibility === "hidden") {
                          this.domElement.style.visibility = "visible";
                      }
                  } else {
                      this.domElement.style.visibility = "hidden";
                  }
              }
          }
docs: Updates the position of the popup based on the dom reference. If the dom reference is no longer visible,
  then the popup is made temporarily invisible (until updatePosition is called again with a visible dom
  reference).